Skip to content

Commit

Permalink
Merge pull request #65 from tsirysndr/fix/minikube-install-on-mac
Browse files Browse the repository at this point in the history
fix: minikube install on mac
  • Loading branch information
tsirysndr authored Jun 22, 2023
2 parents 9301b14 + 80b9f36 commit 9ac99b7
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 34 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ jobs:
- name: Setup Crosup
uses: tsirysndr/setup-crosup@v1
with:
version: 'v0.4.9'
version: 'v0.4.10'
# Add packages to install here
packages: |
deno
Expand Down
8 changes: 4 additions & 4 deletions crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ license = "MIT"
name = "crosup"
readme = "../../README.md"
repository = "https://github.com/tsirysndr/crosup"
version = "0.4.9"
version = "0.4.10"

# 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.8"}
crosup-core = {path = "../core", version = "0.1.9"}
crosup-entity = {version = "0.1.0", path = "../entity"}
crosup-installers = {path = "../installers", version = "0.1.11"}
crosup-installers = {path = "../installers", version = "0.1.12"}
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.7"}
crosup-types = {path = "../types", version = "0.1.8"}
hcl-rs = "0.14.2"
inquire = "0.6.2"
owo-colors = "3.5.0"
Expand Down
6 changes: 3 additions & 3 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ keywords = ["chromebook", "chromeos", "homebrew", "docker", "nix"]
license = "MIT"
name = "crosup-core"
repository = "https://github.com/tsirysndr/crosup"
version = "0.1.8"
version = "0.1.9"

# 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.11"}
crosup-installers = {path = "../installers", version = "0.1.12"}
crosup-macros = {path = "../macros", version = "0.1.3"}
crosup-ssh = {path = "../ssh", version = "0.1.0"}
crosup-types = {path = "../types", version = "0.1.7"}
crosup-types = {path = "../types", version = "0.1.8"}
hcl-rs = "0.14.2"
os-release = "0.1.0"
owo-colors = "3.5.0"
Expand Down
4 changes: 2 additions & 2 deletions crates/installers/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords = ["chromebook", "chromeos", "homebrew", "docker", "nix"]
license = "MIT"
name = "crosup-installers"
repository = "https://github.com/tsirysndr/crosup"
version = "0.1.11"
version = "0.1.12"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand All @@ -16,7 +16,7 @@ anyhow = "1.0.71"
crosup-macros = {path = "../macros", version = "0.1.5"}
crosup-nix = {path = "../nix", version = "0.1.1"}
crosup-ssh = {path = "../ssh", version = "0.1.0"}
crosup-types = {path = "../types", version = "0.1.7"}
crosup-types = {path = "../types", version = "0.1.8"}
indexmap = {version = "1.9.3", features = ["serde"]}
owo-colors = "3.5.0"
ssh2 = {version = "0.9.4", features = ["vendored-openssl"]}
2 changes: 1 addition & 1 deletion crates/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords = ["chromebook", "chromeos", "homebrew", "docker", "nix"]
license = "MIT"
name = "crosup-types"
repository = "https://github.com/tsirysndr/crosup"
version = "0.1.7"
version = "0.1.8"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
52 changes: 34 additions & 18 deletions crates/types/src/brew.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use indexmap::IndexMap;
use os_release::OsRelease;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone, Default)]
Expand Down Expand Up @@ -30,24 +31,39 @@ pub struct Package {
pub fn default_brew_install() -> IndexMap<String, BrewConfiguration> {
let mut brew = IndexMap::new();
let mut pkg = IndexMap::new();
pkg.insert(
"minikube".into(),
super::brew::Package {
name: "minikube".into(),
preinstall: Some(
"sudo apt-get install -y qemu-system libvirt-clients libvirt-daemon-system".into(),
),
postinstall: Some(
r#"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"#
.into(),
),
version_check: Some("minikube version".into()),
..Default::default()
},
);
let mut minikube = super::brew::Package {
name: "minikube".into(),
preinstall: None,
postinstall: None,
version_check: Some("minikube version".into()),
..Default::default()
};

if cfg!(target_os = "linux") {
// determine linux distribution using os-release
if let Ok(os_release) = OsRelease::new() {
let os = os_release.id.to_lowercase();
let os = os.as_str();
match os {
"ubuntu" | "debian" | "linuxmint" | "pop" | "elementary" | "zorin" => {
minikube.preinstall = Some(
"sudo apt-get install -y qemu-system libvirt-clients libvirt-daemon-system"
.into(),
);
minikube.postinstall = Some(
r#"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"#
.into(),
);
}
_ => {}
}
}
}

pkg.insert("minikube".into(), minikube);

pkg.insert(
"tilt".into(),
Expand Down
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
inherit src;

pname = "crosup";
version = "0.4.9";
version = "0.4.10";
cargoExtraArgs = "--package=crosup";

buildInputs = [
Expand Down

0 comments on commit 9ac99b7

Please sign in to comment.