summaryrefslogtreecommitdiffstats
path: root/nixos/modules/system
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2019-05-10 22:53:14 -0400
committerMatthew Bauer <mjbauer95@gmail.com>2019-05-10 22:53:14 -0400
commit93a522cf0c4ce02c01201c77f1f6ce9d19efd9f9 (patch)
tree19945f9032af65b03f968bc02b55cd4c9caa06f5 /nixos/modules/system
parent60381b7b11cf268e85dd9f5374c3726edb15c764 (diff)
nixos/binfmt: fixup
Diffstat (limited to 'nixos/modules/system')
-rw-r--r--nixos/modules/system/boot/binfmt.nix11
1 files changed, 6 insertions, 5 deletions
diff --git a/nixos/modules/system/boot/binfmt.nix b/nixos/modules/system/boot/binfmt.nix
index 7aeb41d4e224..d6c0f0504868 100644
--- a/nixos/modules/system/boot/binfmt.nix
+++ b/nixos/modules/system/boot/binfmt.nix
@@ -246,15 +246,16 @@ in {
nix.extraOptions = lib.mkIf (cfg.emulatedSystems != []) ''
extra-platforms = ${toString (cfg.emulatedSystems ++ lib.optional pkgs.stdenv.hostPlatform.isx86_64 "i686-linux")}
'';
- # nix.sandboxPaths = lib.mkIf (cfg.emulatedSystems != []) ([ "/run/binfmt" ] ++ (map getEmulator cfg.emulatedSystems));
+ nix.sandboxPaths = lib.mkIf (cfg.emulatedSystems != [])
+ ([ "/run/binfmt" ] ++ (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 cfg.registrations));
- system.activationScripts.binfmt = lib.mkIf (cfg.registrations != {}) ''
+ (lib.concatStringsSep "\n" (lib.mapAttrsToList makeBinfmtLine config.boot.binfmt.registrations));
+ system.activationScripts.binfmt = ''
mkdir -p -m 0755 /run/binfmt
- ${lib.concatStringsSep "\n" (lib.mapAttrsToList activationSnippet cfg.registrations)}
+ ${lib.concatStringsSep "\n" (lib.mapAttrsToList activationSnippet config.boot.binfmt.registrations)}
'';
- systemd.additionalUpstreamSystemUnits = lib.mkIf (cfg.registrations != {})
+ systemd.additionalUpstreamSystemUnits = lib.mkIf (config.boot.binfmt.registrations != {})
[ "proc-sys-fs-binfmt_misc.automount"
"proc-sys-fs-binfmt_misc.mount"
];