diff --git a/lib/jail.nix b/lib/jail.nix index d64d708..1ff43a2 100644 --- a/lib/jail.nix +++ b/lib/jail.nix @@ -122,6 +122,9 @@ let # forward man pages // lib.optionalAttrs (exe ? man) { inherit (exe) man; } + # forward `shellPath` + // lib.optionalAttrs (exe ? shellPath) { inherit (exe) shellPath; } + # forward `override` // lib.optionalAttrs (exe ? override) { override = overrideFn: jail name (exe.override overrideFn) permissions; diff --git a/tests/spec/JailSpec.hs b/tests/spec/JailSpec.hs index f7e9de5..d501d19 100644 --- a/tests/spec/JailSpec.hs +++ b/tests/spec/JailSpec.hs @@ -73,6 +73,11 @@ spec = parallel $ inTestM $ do evalNixExpr [i| (jail "not-overridable" (sh "") []) ? override |] 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 it "allows overriding base permissions shared across all jails" $ do tmpDir <- getTestDir