summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2021-01-24 22:47:59 -0600
committerMatthew Bauer <mjbauer95@gmail.com>2021-01-24 22:47:59 -0600
commit35bd8f11535536d14d0dbc9b30c50601370af049 (patch)
tree695fbdc162958c140c5a9f7e7d01ec7541385f8a
parentf217c0ea7c148ddc0103347051555c7c252dcafb (diff)
downloadnixpkgs-35bd8f11535536d14d0dbc9b30c50601370af049.tar
nixpkgs-35bd8f11535536d14d0dbc9b30c50601370af049.tar.gz
nixpkgs-35bd8f11535536d14d0dbc9b30c50601370af049.tar.bz2
nixpkgs-35bd8f11535536d14d0dbc9b30c50601370af049.tar.lz
nixpkgs-35bd8f11535536d14d0dbc9b30c50601370af049.tar.xz
nixpkgs-35bd8f11535536d14d0dbc9b30c50601370af049.tar.zst
nixpkgs-35bd8f11535536d14d0dbc9b30c50601370af049.zip
nixos/binfmt: add bash to sandboxPaths
bash is needed to run the new binfmt shell script.

Fixes #110540
-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 5bcc95be324..cbdf581d73a 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));