Merge pull request #110739 from matthewbauer/fix-binfmt-nix-sandbox

nixos/binfmt: add bash to sandboxPaths

Changed files
+2 -2
nixos
modules
system
boot
+2 -2
nixos/modules/system/boot/binfmt.nix
···
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}
···
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));