Skip to content

Commit

Permalink
add nix to PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Mar 15, 2024
1 parent 708588a commit 231a5da
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .fluentci/src/dagger/jobs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ export async function e2e(
.withServiceBinding("fluentci-engine", engine)
.sync();

ctr = ctr.withExec([
"bash",
"-c",
`http POST http://fluentci-engine:6880/graphql Content-Type:application/json query="$(cat pkgx.graphql)" --ignore-stdin`,
]);

ctr = ctr.withExec([
"bash",
"-c",
Expand Down
5 changes: 5 additions & 0 deletions crates/ext/src/devbox.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::{
env,
io::{BufRead, BufReader},
process::{Command, ExitStatus, Stdio},
sync::mpsc::{self, Receiver, Sender},
Expand Down Expand Up @@ -48,6 +49,7 @@ impl Extension for Devbox {
.arg("-c")
.arg("[ -f devbox.json ] || devbox init")
.current_dir(work_dir)
.env("PATH", env::var("PATH")?)
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
.spawn()?
Expand All @@ -57,6 +59,7 @@ impl Extension for Devbox {
.arg("-c")
.arg(format!("devbox run {}", cmd))
.current_dir(work_dir)
.env("PATH", env::var("PATH")?)
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.spawn()?;
Expand Down Expand Up @@ -114,6 +117,8 @@ impl Extension for Devbox {
let mut child = Command::new("sh")
.arg("-c")
.arg("type devbox > /dev/null || curl -fsSL https://get.jetpack.io/devbox | bash")
.env("FORCE", "1")
.env("PATH", env::var("PATH")?)
.spawn()?;
child.wait()?;
Ok(())
Expand Down
2 changes: 2 additions & 0 deletions crates/ext/src/devenv.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use std::{
env,
io::{BufRead, BufReader},
process::{Command, ExitStatus, Stdio},
sync::mpsc::{self, Receiver, Sender},
Expand Down Expand Up @@ -118,6 +119,7 @@ impl Extension for Devenv {
Command::new("sh")
.arg("-c")
.arg("nix profile install --accept-flake-config github:cachix/cachix")
.env("PATH", env::var("PATH")?)
.spawn()?
.wait()?;

Expand Down
4 changes: 4 additions & 0 deletions crates/ext/src/nix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ impl Extension for Nix {
Command::new("bash")
.arg("-c")
.arg("nix flake init")
.env("PATH", env::var("PATH")?)
.current_dir(work_dir)
.stdout(Stdio::inherit())
.stderr(Stdio::inherit())
Expand All @@ -44,6 +45,7 @@ impl Extension for Nix {
let mut child = Command::new("bash")
.arg("-c")
.arg(format!("nix develop -c {}", cmd))
.env("PATH", env::var("PATH")?)
.current_dir(work_dir)
.stdout(Stdio::piped())
.stderr(Stdio::piped())
Expand Down Expand Up @@ -129,12 +131,14 @@ impl Extension for Nix {
let mut child = Command::new("sh")
.arg("-c")
.arg(format!("type nix > /dev/null || curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install {}", linux))
.env("PATH", env::var("PATH")?)
.spawn()?;
child.wait()?;

let mut child = Command::new("sh")
.arg("-c")
.arg(format!("type nix > /dev/null || curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install {} --no-confirm", linux))
.env("PATH", env::var("PATH")?)
.spawn()?;
child.wait()?;
Ok(())
Expand Down
4 changes: 2 additions & 2 deletions fixtures/flox.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ query Flox {
pipeline(name: "Demo") {
flox {
withWorkDir(path: "./flox-demo") {
withExec(args: ["echo", "hello"]) {
withExec(args: ["flox", "--version"]) {
withExec(args: ["flox", "--version"]) {
withExec(args: ["which", "jq"]) {
id
stdout
}
Expand Down

0 comments on commit 231a5da

Please sign in to comment.