diff options
author | arcnmx <arcnmx@users.noreply.github.com> | 2022-01-22 11:41:23 -0800 |
---|---|---|
committer | arcnmx <git@git.arcn.mx> | 2022-12-01 14:57:59 -0800 |
commit | 0e89c822afd4d60b4bf5c96a35d77b2de9ad624b (patch) | |
tree | 69102a34c7744f5dfcd9d9d1703df43bc94269bf /nixos/modules/system | |
parent | 873074ac6024a36f828f6e44f0c004607e93cba7 (diff) |
nixos/binfmt: mkDefault auto-detected interpreter
Diffstat (limited to 'nixos/modules/system')
-rw-r--r-- | nixos/modules/system/boot/binfmt.nix | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nixos/modules/system/boot/binfmt.nix b/nixos/modules/system/boot/binfmt.nix index e8d63445b44f3..7f817e5d350da 100644 --- a/nixos/modules/system/boot/binfmt.nix +++ b/nixos/modules/system/boot/binfmt.nix @@ -1,6 +1,6 @@ { config, lib, pkgs, ... }: let - inherit (lib) mkOption types optionalString stringAfter; + inherit (lib) mkOption mkDefault types optionalString stringAfter; cfg = config.boot.binfmt; @@ -293,11 +293,11 @@ in { if preserveArgvZero then "${wrapper}/bin/${wrapperName}" else interpreter; in ({ - inherit preserveArgvZero; + preserveArgvZero = mkDefault preserveArgvZero; - interpreter = interpreterReg; - wrapInterpreterInShell = !preserveArgvZero; - interpreterSandboxPath = dirOf (dirOf config.interpreter); + interpreter = mkDefault interpreterReg; + wrapInterpreterInShell = mkDefault (!config.preserveArgvZero); + interpreterSandboxPath = mkDefault (dirOf (dirOf config.interpreter)); } // (magics.${system} or (throw "Cannot create binfmt registration for system ${system}"))); }) cfg.emulatedSystems); nix.settings = lib.mkIf (cfg.emulatedSystems != []) { |