From f6c22bfc4f5ffdd472f3f95e099eebda6949e9c4 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sun, 5 Apr 2020 20:03:54 +0200 Subject: [PATCH] rename nixpkgs entry in NIX_PATH This ensures the local sources are still allowed in restricted mode, but referencing in expressions inside nixpkgs is not. --- ofborg/src/nix.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ofborg/src/nix.rs b/ofborg/src/nix.rs index 0a156f4..80a5205 100644 --- a/ofborg/src/nix.rs +++ b/ofborg/src/nix.rs @@ -298,7 +298,7 @@ impl Nix { where S: AsRef, { - let nixpkgspath = format!("nixpkgs={}", nixpkgs.display()); + let nixpkgspath = format!("ofborg-nixpkgs-pr={}", nixpkgs.display()); let mut nixpath: Vec = safe_paths .iter() .map(|path| format!("{}", path.display())) @@ -577,7 +577,7 @@ mod tests { Expect::Pass, vec![ "HOME=/homeless-shelter", - "NIX_PATH=nixpkgs=", + "NIX_PATH=ofborg-nixpkgs-pr=", "NIX_REMOTE=", "PATH=", ], @@ -604,7 +604,7 @@ mod tests { Expect::Pass, vec![ "HOME=/homeless-shelter", - "NIX_PATH=nixpkgs=", + "NIX_PATH=ofborg-nixpkgs-pr=", "NIX_REMOTE=", "PATH=", "GC_INITIAL_HEAP_SIZE=4g",