mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-18 02:44:30 +00:00
nixos/binfmt: add interpreter path to sandbox
This commit is contained in:
parent
2abf40d9b5
commit
873074ac60
@ -281,7 +281,7 @@ in {
|
||||
config = {
|
||||
boot.binfmt.registrations = builtins.listToAttrs (map (system: {
|
||||
name = system;
|
||||
value = let
|
||||
value = { config, ... }: let
|
||||
interpreter = getEmulator system;
|
||||
qemuArch = getQemuArch system;
|
||||
|
||||
@ -292,13 +292,13 @@ in {
|
||||
in
|
||||
if preserveArgvZero then "${wrapper}/bin/${wrapperName}"
|
||||
else interpreter;
|
||||
in {
|
||||
in ({
|
||||
inherit preserveArgvZero;
|
||||
|
||||
interpreter = interpreterReg;
|
||||
wrapInterpreterInShell = !preserveArgvZero;
|
||||
interpreterSandboxPath = dirOf (dirOf interpreterReg);
|
||||
} // (magics.${system} or (throw "Cannot create binfmt registration for system ${system}"));
|
||||
interpreterSandboxPath = dirOf (dirOf config.interpreter);
|
||||
} // (magics.${system} or (throw "Cannot create binfmt registration for system ${system}")));
|
||||
}) cfg.emulatedSystems);
|
||||
nix.settings = lib.mkIf (cfg.emulatedSystems != []) {
|
||||
extra-platforms = cfg.emulatedSystems ++ lib.optional pkgs.stdenv.hostPlatform.isx86_64 "i686-linux";
|
||||
|
Loading…
Reference in New Issue
Block a user