Forward shellPath on shell derivations

This commit is contained in:
Alex David 2026-01-28 13:46:12 -08:00
commit 54d4c6c0e7
2 changed files with 8 additions and 0 deletions

View file

@ -122,6 +122,9 @@ let
# forward man pages # forward man pages
// lib.optionalAttrs (exe ? man) { inherit (exe) man; } // lib.optionalAttrs (exe ? man) { inherit (exe) man; }
# forward `shellPath`
// lib.optionalAttrs (exe ? shellPath) { inherit (exe) shellPath; }
# forward `override` # forward `override`
// lib.optionalAttrs (exe ? override) { // lib.optionalAttrs (exe ? override) {
override = overrideFn: jail name (exe.override overrideFn) permissions; override = overrideFn: jail name (exe.override overrideFn) permissions;

View file

@ -73,6 +73,11 @@ spec = parallel $ inTestM $ do
evalNixExpr [i| (jail "not-overridable" (sh "") []) ? override |] evalNixExpr [i| (jail "not-overridable" (sh "") []) ? override |]
liftIO $ jailHasOverride `shouldBe` False liftIO $ jailHasOverride `shouldBe` False
it "forwards shellPath from shell packages" $ do
jailedBashShellPath :: String <-
evalNixExpr [i| (jail "bash" pkgs.bash []).shellPath |]
liftIO $ jailedBashShellPath `shouldBe` "/bin/bash"
describe "advanced configuration" $ do describe "advanced configuration" $ do
it "allows overriding base permissions shared across all jails" $ do it "allows overriding base permissions shared across all jails" $ do
tmpDir <- getTestDir tmpDir <- getTestDir