diff --git a/Cargo.lock b/Cargo.lock index 7216a45..d413aec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1069,7 +1069,7 @@ dependencies = [ [[package]] name = "crosup" -version = "0.4.10" +version = "0.5.0" dependencies = [ "anyhow", "clap 3.2.25", @@ -1097,7 +1097,7 @@ dependencies = [ [[package]] name = "crosup-core" -version = "0.1.9" +version = "0.2.0" dependencies = [ "anyhow", "crosup-installers", @@ -1122,7 +1122,7 @@ dependencies = [ [[package]] name = "crosup-installers" -version = "0.1.12" +version = "0.2.0" dependencies = [ "anyhow", "crosup-macros", @@ -1136,7 +1136,7 @@ dependencies = [ [[package]] name = "crosup-macros" -version = "0.1.5" +version = "0.2.0" [[package]] name = "crosup-migration" @@ -1191,7 +1191,7 @@ dependencies = [ [[package]] name = "crosup-types" -version = "0.1.8" +version = "0.2.0" dependencies = [ "hcl-rs", "indexmap", diff --git a/Cargo.toml b/Cargo.toml index c06e40c..4bd4125 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] default-members = ["crates/cli"] members = ["crates/*"] +resolver = "2" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/README.md b/README.md index 8f6ef4c..a21bfec 100644 --- a/README.md +++ b/README.md @@ -107,8 +107,47 @@ Example of a Crosfile.toml (`crosup init --toml`) for a Debian-based system: ```toml # Crosfile.toml +[brew.install.pkg.minikube] +preinstall = "sudo apt-get install -y qemu-system libvirt-clients libvirt-daemon-system" +postinstall = """ +sudo sed -i 's/#user = \"root\"/user = \"root\"/g' /etc/libvirt/qemu.conf + sudo sed -i 's/#group = \"root\"/group = \"root\"/g' /etc/libvirt/qemu.conf + sudo sed -i 's/#dynamic_ownership = 1/dynamic_ownership = 0/g' /etc/libvirt/qemu.conf + sudo sed -i 's/#remember_owner = 1/remember_owner = 0/g' /etc/libvirt/qemu.conf""" + +[brew.install.pkg.tilt] + +[brew.install.pkg.kubernetes-cli] +version_check = "kubectl" + +[brew.install.pkg.bat] + +[brew.install.pkg.direnv] + +[brew.install.pkg.exa] + +[brew.install.pkg.fd] + +[brew.install.pkg.fzf] + +[brew.install.pkg.fish] + +[brew.install.pkg.glow] + +[brew.install.pkg.httpie] +version_check = "http" + +[brew.install.pkg.tig] + +[brew.install.pkg.zellij] + +[brew.install.pkg.zoxide] + +[brew.install.pkg.ripgrep] +version_check = "rg" + [brew.install.pkg.neovim] -version_check = "nvim --version" +version_check = "nvim" [git.install.repo.blesh] url = "https://github.com/akinomyoga/ble.sh.git" @@ -126,7 +165,6 @@ experimental_features = "nix-command flakes" accept_flake_config = true preinstall = "echo 'extra-trusted-substituters = https://cache.floxdev.com' | sudo tee -a /etc/nix/nix.conf && echo 'extra-trusted-public-keys = flox-store-public-0:8c/B+kjIaQ+BloCmNkRUKwaVPFWkriSAd0JJvuDu4F0=' | sudo tee -a /etc/nix/nix.conf" flake = "github:flox/floxpkgs#flox.fromCatalog" -version_check = ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && flox --version" [nix.install.pkg.cachix] flake = "github:cachix/cachix" @@ -139,11 +177,9 @@ sudo pkill nix-daemon cachix use devenv""" flake = "github:cachix/devenv/latest" depends_on = ["cachix"] -version_check = ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && devenv version" [curl.install.script.devbox] url = "https://get.jetpack.io/devbox" -version_check = "devbox version" shell = "bash" depends_on = ["nix"] @@ -152,19 +188,17 @@ FORCE = "1" [curl.install.script.atuin] url = "https://raw.githubusercontent.com/ellie/atuin/main/install.sh" -version_check = "atuin --version" shell = "bash" [curl.install.script.nix] url = "https://install.determinate.systems/nix" enable_sudo = true -version_check = ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix --version" args = "install --no-confirm" [curl.install.script.homebrew] url = "https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh" postinstall = "echo 'eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)' >> ~/.bashrc" -version_check = "brew --version" +version_check = "brew" shell = "bash" [curl.install.script.homebrew.env] @@ -188,11 +222,10 @@ depends_on = [ "gnupg", ] postinstall = "sudo usermod -aG docker $USER && newgrp docker" -version_check = "docker --version" [apt.install.pkg.vscode] url = "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64" -version_check = "code --version" +version_check = "code" ``` diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 0d92013..3644be4 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -8,22 +8,22 @@ license = "MIT" name = "crosup" readme = "../../README.md" repository = "https://github.com/tsirysndr/crosup" -version = "0.4.10" +version = "0.5.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1.0.71" clap = "3.2.20" -crosup-core = {path = "../core", version = "0.1.9"} +crosup-core = {path = "../core", version = "0.2.0"} crosup-entity = {version = "0.1.0", path = "../entity"} -crosup-installers = {path = "../installers", version = "0.1.12"} +crosup-installers = {path = "../installers", version = "0.2.0"} crosup-migration = {path = "../migration", version = "0.1.0"} crosup-nix = {path = "../nix", version = "0.1.1"} crosup-repo = {path = "../repo", version = "0.1.0"} crosup-ssh = {path = "../ssh", version = "0.1.0"} crosup-tui = {path = "../tui", version = "0.1.0"} -crosup-types = {path = "../types", version = "0.1.8"} +crosup-types = {path = "../types", version = "0.2.0"} hcl-rs = "0.14.2" inquire = "0.6.2" owo-colors = "3.5.0" diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index de4a63a..f35bcc0 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -7,16 +7,16 @@ keywords = ["chromebook", "chromeos", "homebrew", "docker", "nix"] license = "MIT" name = "crosup-core" repository = "https://github.com/tsirysndr/crosup" -version = "0.1.9" +version = "0.2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1.0.71" -crosup-installers = {path = "../installers", version = "0.1.12"} -crosup-macros = {path = "../macros", version = "0.1.3"} +crosup-installers = {path = "../installers", version = "0.2.0"} +crosup-macros = {path = "../macros", version = "0.2.0"} crosup-ssh = {path = "../ssh", version = "0.1.0"} -crosup-types = {path = "../types", version = "0.1.8"} +crosup-types = {path = "../types", version = "0.2.0"} hcl-rs = "0.14.2" os-release = "0.1.0" owo-colors = "3.5.0" diff --git a/crates/installers/Cargo.toml b/crates/installers/Cargo.toml index ac8ddb4..448263c 100644 --- a/crates/installers/Cargo.toml +++ b/crates/installers/Cargo.toml @@ -7,16 +7,16 @@ keywords = ["chromebook", "chromeos", "homebrew", "docker", "nix"] license = "MIT" name = "crosup-installers" repository = "https://github.com/tsirysndr/crosup" -version = "0.1.12" +version = "0.2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] anyhow = "1.0.71" -crosup-macros = {path = "../macros", version = "0.1.5"} +crosup-macros = {path = "../macros", version = "0.2.0"} crosup-nix = {path = "../nix", version = "0.1.1"} crosup-ssh = {path = "../ssh", version = "0.1.0"} -crosup-types = {path = "../types", version = "0.1.8"} +crosup-types = {path = "../types", version = "0.2.0"} indexmap = {version = "1.9.3", features = ["serde"]} owo-colors = "3.5.0" ssh2 = {version = "0.9.4", features = ["vendored-openssl"]} diff --git a/crates/installers/src/apk.rs b/crates/installers/src/apk.rs index 102fd55..235a437 100644 --- a/crates/installers/src/apk.rs +++ b/crates/installers/src/apk.rs @@ -95,14 +95,16 @@ impl Installer for ApkInstaller { } fn is_installed(&self) -> Result { + println!( + "-> Checking if {} is already installed", + self.name.bright_green() + ); if let Some(command) = self.version_check.clone() { - println!( - "-> Checking if {} is already installed", - self.name.bright_green() - ); check_version!(self, command, self.session.clone()); - return Ok(true); + return Ok(false); } + let command = self.name.clone(); + check_version!(self, command, self.session.clone()); Ok(false) } diff --git a/crates/installers/src/apt.rs b/crates/installers/src/apt.rs index b5a68b6..440dbdd 100644 --- a/crates/installers/src/apt.rs +++ b/crates/installers/src/apt.rs @@ -242,13 +242,16 @@ impl Installer for AptInstaller { } fn is_installed(&self) -> Result { + println!( + "-> Checking if {} is already installed", + self.name.bright_green() + ); if let Some(command) = self.version_check.clone() { - println!( - "-> Checking if {} is already installed", - self.name.bright_green() - ); check_version!(self, command, self.session.clone()); + return Ok(false); } + let command = self.name.clone(); + check_version!(self, command, self.session.clone()); Ok(false) } diff --git a/crates/installers/src/brew.rs b/crates/installers/src/brew.rs index 7000f92..1c43a75 100644 --- a/crates/installers/src/brew.rs +++ b/crates/installers/src/brew.rs @@ -30,7 +30,6 @@ impl From for BrewInstaller { version: "latest".to_string(), dependencies: vec!["homebrew".into()], pkgs: config.pkgs.unwrap_or(vec![]), - provider: "brew".into(), ..Default::default() } } @@ -94,14 +93,17 @@ impl Installer for BrewInstaller { } fn is_installed(&self) -> Result { + println!( + "-> Checking if {} is already installed", + self.name.bright_green() + ); if let Some(command) = self.version_check.clone() { - println!( - "-> Checking if {} is already installed", - self.name.bright_green() - ); check_version!(self, command, self.session.clone()); + return Ok(false); } - Ok(true) + let command = self.name.clone(); + check_version!(self, command, self.session.clone()); + Ok(false) } fn name(&self) -> &str { diff --git a/crates/installers/src/curl.rs b/crates/installers/src/curl.rs index a2a4b4d..40fdafd 100644 --- a/crates/installers/src/curl.rs +++ b/crates/installers/src/curl.rs @@ -122,13 +122,16 @@ impl Installer for CurlInstaller { } fn is_installed(&self) -> Result { + println!( + "-> Checking if {} is already installed", + self.name.bright_green() + ); if let Some(command) = self.version_check.clone() { - println!( - "-> Checking if {} is already installed", - self.name.bright_green() - ); check_version!(self, command, self.session.clone()); + return Ok(false); } + let command = self.name.clone(); + check_version!(self, command, self.session.clone()); Ok(false) } diff --git a/crates/installers/src/dnf.rs b/crates/installers/src/dnf.rs index 5fc3b1e..b05e804 100644 --- a/crates/installers/src/dnf.rs +++ b/crates/installers/src/dnf.rs @@ -88,14 +88,16 @@ impl Installer for DnfInstaller { } fn is_installed(&self) -> Result { + println!( + "-> Checking if {} is already installed", + self.name.bright_green() + ); if let Some(command) = self.version_check.clone() { - println!( - "-> Checking if {} is already installed", - self.name.bright_green() - ); check_version!(self, command, self.session.clone()); - return Ok(true); + return Ok(false); } + let command = self.name.clone(); + check_version!(self, command, self.session.clone()); Ok(false) } diff --git a/crates/installers/src/emerge.rs b/crates/installers/src/emerge.rs index 93f1081..517e433 100644 --- a/crates/installers/src/emerge.rs +++ b/crates/installers/src/emerge.rs @@ -100,14 +100,16 @@ impl Installer for EmergeInstaller { } fn is_installed(&self) -> Result { + println!( + "-> Checking if {} is already installed", + self.name.bright_green() + ); if let Some(command) = self.version_check.clone() { - println!( - "-> Checking if {} is already installed", - self.name.bright_green() - ); check_version!(self, command, self.session.clone()); - return Ok(true); + return Ok(false); } + let command = self.name.clone(); + check_version!(self, command, self.session.clone()); Ok(false) } diff --git a/crates/installers/src/fleek.rs b/crates/installers/src/fleek.rs index 3b8df97..97b1757 100644 --- a/crates/installers/src/fleek.rs +++ b/crates/installers/src/fleek.rs @@ -105,14 +105,16 @@ impl Installer for FleekInstaller { } fn is_installed(&self) -> Result { + println!( + "-> Checking if {} is already installed", + self.name.bright_green() + ); if let Some(command) = self.version_check.clone() { - println!( - "-> Checking if {} is already installed", - self.name.bright_green() - ); check_version!(self, command, self.session.clone()); - return Ok(true); + return Ok(false); } + let command = self.name.clone(); + check_version!(self, command, self.session.clone()); Ok(false) } diff --git a/crates/installers/src/nix.rs b/crates/installers/src/nix.rs index e56ba89..1d89975 100644 --- a/crates/installers/src/nix.rs +++ b/crates/installers/src/nix.rs @@ -105,13 +105,16 @@ impl Installer for NixInstaller { } fn is_installed(&self) -> Result { + println!( + "-> Checking if {} is already installed", + self.name.bright_green() + ); if let Some(command) = self.version_check.clone() { - println!( - "-> Checking if {} is already installed", - self.name.bright_green() - ); check_version!(self, command, self.session.clone()); + return Ok(false); } + let command = self.name.clone(); + check_version!(self, command, self.session.clone()); Ok(false) } diff --git a/crates/installers/src/pacman.rs b/crates/installers/src/pacman.rs index 9b11347..fa9e756 100644 --- a/crates/installers/src/pacman.rs +++ b/crates/installers/src/pacman.rs @@ -89,14 +89,16 @@ impl Installer for PacmanInstaller { } fn is_installed(&self) -> Result { + println!( + "-> Checking if {} is already installed", + self.name.bright_green() + ); if let Some(command) = self.version_check.clone() { - println!( - "-> Checking if {} is already installed", - self.name.bright_green() - ); check_version!(self, command, self.session.clone()); - return Ok(true); + return Ok(false); } + let command = self.name.clone(); + check_version!(self, command, self.session.clone()); Ok(false) } diff --git a/crates/installers/src/slackpkg.rs b/crates/installers/src/slackpkg.rs index a0e9ba2..7bddb8e 100644 --- a/crates/installers/src/slackpkg.rs +++ b/crates/installers/src/slackpkg.rs @@ -88,14 +88,16 @@ impl Installer for SlackpkgInstaller { } fn is_installed(&self) -> Result { + println!( + "-> Checking if {} is already installed", + self.name.bright_green() + ); if let Some(command) = self.version_check.clone() { - println!( - "-> Checking if {} is already installed", - self.name.bright_green() - ); check_version!(self, command, self.session.clone()); - return Ok(true); + return Ok(false); } + let command = self.name.clone(); + check_version!(self, command, self.session.clone()); Ok(false) } diff --git a/crates/installers/src/yum.rs b/crates/installers/src/yum.rs index 9932250..68a538a 100644 --- a/crates/installers/src/yum.rs +++ b/crates/installers/src/yum.rs @@ -88,14 +88,16 @@ impl Installer for YumInstaller { } fn is_installed(&self) -> Result { + println!( + "-> Checking if {} is already installed", + self.name.bright_green() + ); if let Some(command) = self.version_check.clone() { - println!( - "-> Checking if {} is already installed", - self.name.bright_green() - ); check_version!(self, command, self.session.clone()); - return Ok(true); + return Ok(false); } + let command = self.name.clone(); + check_version!(self, command, self.session.clone()); Ok(false) } diff --git a/crates/installers/src/zypper.rs b/crates/installers/src/zypper.rs index 1b55e2d..91fe375 100644 --- a/crates/installers/src/zypper.rs +++ b/crates/installers/src/zypper.rs @@ -94,14 +94,16 @@ impl Installer for ZypperInstaller { } fn is_installed(&self) -> Result { + println!( + "-> Checking if {} is already installed", + self.name.bright_green() + ); if let Some(command) = self.version_check.clone() { - println!( - "-> Checking if {} is already installed", - self.name.bright_green() - ); check_version!(self, command, self.session.clone()); - return Ok(true); + return Ok(false); } + let command = self.name.clone(); + check_version!(self, command, self.session.clone()); Ok(false) } diff --git a/crates/macros/Cargo.toml b/crates/macros/Cargo.toml index 07243ab..9c4bf8d 100644 --- a/crates/macros/Cargo.toml +++ b/crates/macros/Cargo.toml @@ -7,7 +7,7 @@ keywords = ["chromebook", "chromeos", "homebrew", "docker", "nix"] license = "MIT" name = "crosup-macros" repository = "https://github.com/tsirysndr/crosup" -version = "0.1.5" +version = "0.2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/macros/src/lib.rs b/crates/macros/src/lib.rs index 8c1d16f..4a87b21 100644 --- a/crates/macros/src/lib.rs +++ b/crates/macros/src/lib.rs @@ -94,16 +94,23 @@ macro_rules! check_version { ($self:ident, $command:expr, $session:expr) => { match $session { Some(session) => { - let command = format!("sh -c 'PATH=/home/linuxbrew/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin {}'", $command); + let command = format!("sh -c 'PATH=$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/linuxbrew/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin type {}'", $command); crosup_ssh::exec(session.clone(), &command)?; } None => { + let home = std::env::var("HOME").unwrap(); + let mut path = std::env::var("PATH").unwrap(); + path = format!( + "{}/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/home/linuxbrew/.linuxbrew/bin:{}", + home, + path + ); let child = std::process::Command::new("bash") .arg("-c") - .arg($command) + .arg(format!("type {}", $command)) .env( "PATH", - "/home/linuxbrew/.linuxbrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin", + path, ) .stdout(Stdio::piped()) .spawn()?; diff --git a/crates/types/Cargo.toml b/crates/types/Cargo.toml index a5c49b4..ec45834 100644 --- a/crates/types/Cargo.toml +++ b/crates/types/Cargo.toml @@ -7,7 +7,7 @@ keywords = ["chromebook", "chromeos", "homebrew", "docker", "nix"] license = "MIT" name = "crosup-types" repository = "https://github.com/tsirysndr/crosup" -version = "0.1.8" +version = "0.2.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/types/src/apt.rs b/crates/types/src/apt.rs index 2cbf095..bfd66aa 100644 --- a/crates/types/src/apt.rs +++ b/crates/types/src/apt.rs @@ -70,7 +70,6 @@ pub fn default_apt_install() -> IndexMap { ]), depends_on: Some(vec!["ca-certificates".into(),"curl".into(), "gnupg".into()]), postinstall: Some("sudo usermod -aG docker $USER && newgrp docker".into()), - version_check: Some("docker --version".into()), ..Default::default() }, ); @@ -84,7 +83,7 @@ pub fn default_apt_install() -> IndexMap { url: Some( "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64".into(), ), - version_check: Some("code --version".into()), + version_check: Some("code".into()), ..Default::default() }, ); diff --git a/crates/types/src/brew.rs b/crates/types/src/brew.rs index baf5af9..239eec6 100644 --- a/crates/types/src/brew.rs +++ b/crates/types/src/brew.rs @@ -35,7 +35,6 @@ pub fn default_brew_install() -> IndexMap { name: "minikube".into(), preinstall: None, postinstall: None, - version_check: Some("minikube version".into()), ..Default::default() }; @@ -68,7 +67,6 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "tilt".into(), super::brew::Package { - version_check: Some("tilt version".into()), ..Default::default() }, ); @@ -76,7 +74,7 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "kubernetes-cli".into(), super::brew::Package { - version_check: Some("kubectl version --client".into()), + version_check: Some("kubectl".into()), ..Default::default() }, ); @@ -84,7 +82,6 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "bat".into(), super::brew::Package { - version_check: Some("bat --version".into()), ..Default::default() }, ); @@ -92,7 +89,6 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "direnv".into(), super::brew::Package { - version_check: Some("direnv --version".into()), ..Default::default() }, ); @@ -100,7 +96,6 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "exa".into(), super::brew::Package { - version_check: Some("exa --version".into()), ..Default::default() }, ); @@ -108,7 +103,6 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "fd".into(), super::brew::Package { - version_check: Some("fd --version".into()), ..Default::default() }, ); @@ -116,7 +110,6 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "fzf".into(), super::brew::Package { - version_check: Some("fzf --version".into()), ..Default::default() }, ); @@ -124,7 +117,6 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "fish".into(), super::brew::Package { - version_check: Some("fish --version".into()), ..Default::default() }, ); @@ -132,7 +124,6 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "glow".into(), super::brew::Package { - version_check: Some("glow --version".into()), ..Default::default() }, ); @@ -140,7 +131,7 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "httpie".into(), super::brew::Package { - version_check: Some("http --version".into()), + version_check: Some("http".into()), ..Default::default() }, ); @@ -148,7 +139,6 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "tig".into(), super::brew::Package { - version_check: Some("tig --version".into()), ..Default::default() }, ); @@ -156,7 +146,6 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "zellij".into(), super::brew::Package { - version_check: Some("zellij --version".into()), ..Default::default() }, ); @@ -164,7 +153,6 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "zoxide".into(), super::brew::Package { - version_check: Some("zoxide --version".into()), ..Default::default() }, ); @@ -172,7 +160,7 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "ripgrep".into(), super::brew::Package { - version_check: Some("rg --version".into()), + version_check: Some("rg".into()), ..Default::default() }, ); @@ -180,7 +168,7 @@ pub fn default_brew_install() -> IndexMap { pkg.insert( "neovim".into(), super::brew::Package { - version_check: Some("nvim --version".into()), + version_check: Some("nvim".into()), ..Default::default() }, ); @@ -190,7 +178,6 @@ pub fn default_brew_install() -> IndexMap { "docker".into(), super::brew::Package { cask: Some(true), - version_check: Some("docker --version".into()), ..Default::default() }, ); @@ -198,7 +185,7 @@ pub fn default_brew_install() -> IndexMap { "visual-studio-code".into(), super::brew::Package { cask: Some(true), - version_check: Some("code --version".into()), + version_check: Some("code".into()), ..Default::default() }, ); diff --git a/crates/types/src/curl.rs b/crates/types/src/curl.rs index 131f4f3..53f4663 100644 --- a/crates/types/src/curl.rs +++ b/crates/types/src/curl.rs @@ -43,9 +43,6 @@ pub fn default_nix_installer() -> Script { name: "nix".into(), url: "https://install.determinate.systems/nix".into(), enable_sudo: Some(true), - version_check: Some( - ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && nix --version".into(), - ), args: Some("install --no-confirm".into()), ..Default::default() } @@ -64,7 +61,7 @@ pub fn default_brew_installer() -> Script { name: "homebrew".into(), url: "https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh".into(), postinstall, - version_check: Some("brew --version".into()), + version_check: Some("brew".into()), env: Some( [("NONINTERACTIVE".into(), "true".into())] .iter() @@ -83,7 +80,6 @@ pub fn default_curl_install() -> IndexMap { Script { name: "devbox".into(), url: "https://get.jetpack.io/devbox".into(), - version_check: Some("devbox version".into()), shell: Some("bash".into()), depends_on: Some(vec!["nix".into()]), env: Some([("FORCE".into(), "1".into())].iter().cloned().collect()), @@ -96,7 +92,6 @@ pub fn default_curl_install() -> IndexMap { Script { name: "atuin".into(), url: "https://raw.githubusercontent.com/ellie/atuin/main/install.sh".into(), - version_check: Some("atuin --version".into()), shell: Some("bash".into()), ..Default::default() }, diff --git a/crates/types/src/nix.rs b/crates/types/src/nix.rs index 8e92266..f0ed893 100644 --- a/crates/types/src/nix.rs +++ b/crates/types/src/nix.rs @@ -42,7 +42,6 @@ pub fn default_nix_install() -> IndexMap { accept_flake_config: Some(true), flake: "github:flox/floxpkgs#flox.fromCatalog".into(), preinstall: Some("echo 'extra-trusted-substituters = https://cache.floxdev.com' | sudo tee -a /etc/nix/nix.conf && echo 'extra-trusted-public-keys = flox-store-public-0:8c/B+kjIaQ+BloCmNkRUKwaVPFWkriSAd0JJvuDu4F0=' | sudo tee -a /etc/nix/nix.conf".into()), - version_check: Some(". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && flox --version".into()), ..Default::default() } ); @@ -69,10 +68,6 @@ cachix use devenv"# .into(), ), depends_on: Some(vec!["cachix".into()]), - version_check: Some( - ". /nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh && devenv version" - .into(), - ), ..Default::default() }, );