| 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() | |
| } |