summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2021-01-25 11:53:27 -0600
committerGitHub <noreply@github.com>2021-01-25 11:53:27 -0600
commite8338c9c1df9643a9f5870d3a320d93b92ed01fd (patch)
tree06e70d11b63999c04b2947b4d8eee240785ef0e2 /nixos
parenta979486bb546d9444f3ff82ccff1fd32082ca205 (diff)
parent35bd8f11535536d14d0dbc9b30c50601370af049 (diff)
Merge pull request #110739 from matthewbauer/fix-binfmt-nix-sandbox
nixos/binfmt: add bash to sandboxPaths
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/binfmt.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/system/boot/binfmt.nix b/nixos/modules/system/boot/binfmt.nix
index 5bcc95be324a..cbdf581d73a7 100644
--- a/nixos/modules/system/boot/binfmt.nix
+++ b/nixos/modules/system/boot/binfmt.nix
@@ -23,7 +23,7 @@ let
activationSnippet = name: { interpreter, ... }: ''
rm -f /run/binfmt/${name}
cat > /run/binfmt/${name} << 'EOF'
- #!/usr/bin/env sh
+ #!${pkgs.bash}/bin/sh
exec -- ${interpreter} "$@"
EOF
chmod +x /run/binfmt/${name}
@@ -266,7 +266,7 @@ in {
extra-platforms = ${toString (cfg.emulatedSystems ++ lib.optional pkgs.stdenv.hostPlatform.isx86_64 "i686-linux")}
'';
nix.sandboxPaths = lib.mkIf (cfg.emulatedSystems != [])
- ([ "/run/binfmt" ] ++ (map (system: dirOf (dirOf (getEmulator system))) cfg.emulatedSystems));
+ ([ "/run/binfmt" "${pkgs.bash}" ] ++ (map (system: dirOf (dirOf (getEmulator system))) cfg.emulatedSystems));
environment.etc."binfmt.d/nixos.conf".source = builtins.toFile "binfmt_nixos.conf"
(lib.concatStringsSep "\n" (lib.mapAttrsToList makeBinfmtLine config.boot.binfmt.registrations));