diamond-in's picture
Update src/agent/executor.rs
2d766b8 verified
raw
history blame
372 Bytes
use std::process::Command;
pub fn run_in_nix(cmd: &str, packages: Vec<&str>) -> String {
let pkgs = packages.join(" ");
let output = Command::new("nix-shell")
.arg("-p")
.arg(pkgs)
.arg("--run")
.arg(cmd)
.output()
.expect("failed to execute nix command");
String::from_utf8_lossy(&output.stdout).to_string()
}