Skip to content

Commit e891606

Browse files
authored
Merge pull request #29 from fluentci-io/fix/nix-trusted-users
fix issue with nix trusted users on macos
2 parents 1ad35ba + f8a6a28 commit e891606

File tree

10 files changed

+55
-35
lines changed

10 files changed

+55
-35
lines changed

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/cli/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,18 @@ license = "MPL-2.0"
88
name = "fluentci-engine"
99
readme = "../../README.md"
1010
repository = "https://github.com/fluentci-io/fluentci-engine"
11-
version = "0.4.2"
11+
version = "0.4.3"
1212

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

1515
[dependencies]
1616
anyhow = "1.0.81"
1717
clap = "3.2.20"
1818
extism = "1.2.0"
19-
fluentci-core = {path = "../core", version = "0.3.0"}
20-
fluentci-ext = {path = "../ext", version = "0.2.0"}
21-
fluentci-server = {path = "../server", version = "0.3.0"}
22-
fluentci-shared = {path = "../shared", version = "0.2.0"}
19+
fluentci-core = {path = "../core", version = "0.3.1"}
20+
fluentci-ext = {path = "../ext", version = "0.2.1"}
21+
fluentci-server = {path = "../server", version = "0.3.1"}
22+
fluentci-shared = {path = "../shared", version = "0.2.1"}
2323
get-port = "4.0.0"
2424
md5 = "0.7.0"
2525
regex = "1.10.3"

crates/common/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ keywords = ["nix", "environment", "ci", "wasm", "devops"]
77
license = "MPL-2.0"
88
name = "fluentci-common"
99
repository = "https://github.com/fluentci-io/fluentci-engine"
10-
version = "0.2.0"
10+
version = "0.2.1"
1111

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

1414
[dependencies]
1515
anyhow = "1.0.81"
1616
dirs = "5.0.1"
17-
fluentci-core = {path = "../core", version = "0.3.0"}
18-
fluentci-ext = {path = "../ext", version = "0.2.0"}
17+
fluentci-core = {path = "../core", version = "0.3.1"}
18+
fluentci-ext = {path = "../ext", version = "0.2.1"}
1919
fluentci-secrets = {path = "../secrets", version = "0.1.0"}
2020
fluentci-types = {path = "../types", version = "0.1.7"}
2121
regex = "1.10.4"

crates/core/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ keywords = ["nix", "environment", "ci", "wasm", "devops"]
77
license = "MPL-2.0"
88
name = "fluentci-core"
99
repository = "https://github.com/fluentci-io/fluentci-engine"
10-
version = "0.3.0"
10+
version = "0.3.1"
1111

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

1414
[dependencies]
1515
anyhow = "1.0.81"
1616
chrono = "0.4.35"
1717
dirs = "5.0.1"
18-
fluentci-ext = {path = "../ext", version = "0.2.0"}
18+
fluentci-ext = {path = "../ext", version = "0.2.1"}
1919
fluentci-logging = {path = "../logging", version = "0.1.0"}
2020
fluentci-secrets = {path = "../secrets", version = "0.1.0"}
2121
fluentci-types = {path = "../types", version = "0.1.7"}

crates/ext/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ keywords = ["nix", "environment", "ci", "wasm", "devops"]
77
license = "MPL-2.0"
88
name = "fluentci-ext"
99
repository = "https://github.com/fluentci-io/fluentci-engine"
10-
version = "0.2.0"
10+
version = "0.2.1"
1111

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

crates/ext/src/devenv.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::{
2+
env::consts::OS,
23
process::{Command, ExitStatus, Stdio},
34
sync::mpsc::Sender,
45
};
@@ -67,12 +68,21 @@ impl Extension for Devenv {
6768
"echo \"trusted-users = root $USER\" | {} tee -a /etc/nix/nix.conf",
6869
sudo
6970
))
71+
.stdout(Stdio::inherit())
72+
.stderr(Stdio::inherit())
7073
.spawn()?
7174
.wait()?;
7275

76+
let sudo = if OS == "macos" { "sudo" } else { "" };
77+
7378
Command::new("sh")
7479
.arg("-c")
75-
.arg("nix profile install --accept-flake-config github:cachix/cachix")
80+
.arg(&format!(
81+
"{} nix profile install --accept-flake-config github:cachix/cachix",
82+
sudo,
83+
))
84+
.stdout(Stdio::inherit())
85+
.stderr(Stdio::inherit())
7686
.spawn()?
7787
.wait()?;
7888

@@ -84,7 +94,7 @@ impl Extension for Devenv {
8494

8595
Command::new("sh")
8696
.arg("-c")
87-
.arg("nix profile install --accept-flake-config tarball+https://install.devenv.sh/latest")
97+
.arg(&format!("{} nix profile install --accept-flake-config tarball+https://install.devenv.sh/latest",sudo ))
8898
.spawn()?
8999
.wait()?;
90100

crates/ext/src/flox.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use std::{
2+
env::consts::OS,
23
process::{Command, ExitStatus, Stdio},
34
sync::mpsc::Sender,
45
};
@@ -65,23 +66,32 @@ impl Extension for Flox {
6566
"echo \"trusted-users = root $USER\" | {} tee -a /etc/nix/nix.conf",
6667
sudo
6768
))
69+
.stdout(Stdio::inherit())
70+
.stderr(Stdio::inherit())
6871
.spawn()?
6972
.wait()?;
7073

74+
let sudo = if OS == "macos" { "sudo" } else { "" };
75+
7176
Command::new("sh")
7277
.arg("-c")
7378
.arg(&format!("echo 'extra-trusted-substituters = https://cache.floxdev.com' | {} tee -a /etc/nix/nix.conf && echo 'extra-trusted-public-keys = flox-cache-public-1:7F4OyH7ZCnFhcze3fJdfyXYLQw/aV7GEed86nQ7IsOs=' | {} tee -a /etc/nix/nix.conf", sudo, sudo))
79+
.stdout(Stdio::inherit())
80+
.stderr(Stdio::inherit())
7481
.spawn()?
7582
.wait()?;
7683

7784
Command::new("sh")
7885
.arg("-c")
79-
.arg(
80-
"nix profile install --impure \
86+
.arg(&format!(
87+
"{} nix profile install --impure \
8188
--experimental-features 'nix-command flakes' \
8289
--accept-flake-config \
8390
github:flox/flox",
84-
)
91+
sudo
92+
))
93+
.stdout(Stdio::inherit())
94+
.stderr(Stdio::inherit())
8595
.spawn()?
8696
.wait()?;
8797

crates/graphql/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ keywords = ["nix", "environment", "ci", "wasm", "devops"]
77
license = "MPL-2.0"
88
name = "fluentci-graphql"
99
repository = "https://github.com/fluentci-io/fluentci-engine"
10-
version = "0.3.0"
10+
version = "0.3.1"
1111

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

@@ -16,9 +16,9 @@ anyhow = "1.0.80"
1616
async-graphql = "7.0.2"
1717
async-graphql-actix-web = "7.0.2"
1818
dirs = "5.0.1"
19-
fluentci-common = {path = "../common", version = "0.2.0"}
20-
fluentci-core = {path = "../core", version = "0.3.0"}
21-
fluentci-ext = {path = "../ext", version = "0.2.0"}
19+
fluentci-common = {path = "../common", version = "0.2.1"}
20+
fluentci-core = {path = "../core", version = "0.3.1"}
21+
fluentci-ext = {path = "../ext", version = "0.2.1"}
2222
fluentci-secrets = {path = "../secrets", version = "0.1.0"}
2323
fluentci-types = {path = "../types", version = "0.1.7"}
2424
regex = "1.10.3"

crates/server/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ keywords = ["nix", "environment", "ci", "wasm", "devops"]
77
license = "MPL-2.0"
88
name = "fluentci-server"
99
repository = "https://github.com/fluentci-io/fluentci-engine"
10-
version = "0.3.0"
10+
version = "0.3.1"
1111

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

@@ -17,9 +17,9 @@ actix-web = "4.5.1"
1717
anyhow = "1.0.81"
1818
async-graphql = "7.0.2"
1919
async-graphql-actix-web = "7.0.2"
20-
fluentci-core = {path = "../core", version = "0.3.0"}
21-
fluentci-ext = {path = "../ext", version = "0.2.0"}
22-
fluentci-graphql = {path = "../graphql", version = "0.3.0"}
20+
fluentci-core = {path = "../core", version = "0.3.1"}
21+
fluentci-ext = {path = "../ext", version = "0.2.1"}
22+
fluentci-graphql = {path = "../graphql", version = "0.3.1"}
2323
mime_guess = "2.0.4"
2424
owo-colors = "4.0.0"
2525
tokio = "1.36.0"

crates/shared/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ keywords = ["nix", "environment", "ci", "wasm", "devops"]
77
license = "MPL-2.0"
88
name = "fluentci-shared"
99
repository = "https://github.com/fluentci-io/fluentci-engine"
10-
version = "0.2.0"
10+
version = "0.2.1"
1111

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

1414
[dependencies]
1515
anyhow = "1.0.82"
1616
extism = "1.2.0"
1717
extism-pdk = "1.1.0"
18-
fluentci-common = {path = "../common", version = "0.2.0"}
19-
fluentci-core = {path = "../core", version = "0.3.0"}
20-
fluentci-ext = {path = "../ext", version = "0.2.0"}
18+
fluentci-common = {path = "../common", version = "0.2.1"}
19+
fluentci-core = {path = "../core", version = "0.3.1"}
20+
fluentci-ext = {path = "../ext", version = "0.2.1"}
2121
fluentci-secrets = {path = "../secrets", version = "0.1.0"}
2222
fluentci-types = {path = "../types", version = "0.1.7"}
2323
serde = {version = "1.0.197", features = ["serde_derive", "derive"]}

0 commit comments

Comments
 (0)