summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-05-13 16:29:34 +0200
committerFlorian Klink <flokli@flokli.de>2020-05-18 11:18:44 +0200
commit4e2715934e2c995554c5d70fe4eea12716425480 (patch)
tree1019f39b5aaa6aa584ae18121f24ffaa9883d3c7 /nixos
parent3ec270c2452270077b9dfd9b694d1dcaca5a1e1e (diff)
downloadnixpkgs-4e2715934e2c995554c5d70fe4eea12716425480.tar
nixpkgs-4e2715934e2c995554c5d70fe4eea12716425480.tar.gz
nixpkgs-4e2715934e2c995554c5d70fe4eea12716425480.tar.bz2
nixpkgs-4e2715934e2c995554c5d70fe4eea12716425480.tar.lz
nixpkgs-4e2715934e2c995554c5d70fe4eea12716425480.tar.xz
nixpkgs-4e2715934e2c995554c5d70fe4eea12716425480.tar.zst
nixpkgs-4e2715934e2c995554c5d70fe4eea12716425480.zip
nixos/binfmt: move systemd-binfmt.service to binfmt module
Also, remove the dangling systemd.services.systemd-binfmt.wants = [
"proc-sys-fs-binfmt_misc.mount" ]; in systemd.nix.

If boot.binfmt.registrations != {}, systemd will install
proc-sys-fs-binfmt_misc.automount, which will auto-mount
`/proc/sys/fs/binfmt_misc` as soon as systemd-binfmt tries to access it.

Fixes https://github.com/NixOS/nixpkgs/issues/87687
Fixes https://github.com/NixOS/nixops/issues/574
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/system/boot/binfmt.nix9
-rw-r--r--nixos/modules/system/boot/systemd.nix2
2 files changed, 5 insertions, 6 deletions
diff --git a/nixos/modules/system/boot/binfmt.nix b/nixos/modules/system/boot/binfmt.nix
index a677ab4cb71..9eeae0c3ef4 100644
--- a/nixos/modules/system/boot/binfmt.nix
+++ b/nixos/modules/system/boot/binfmt.nix
@@ -268,9 +268,10 @@ in {
       mkdir -p -m 0755 /run/binfmt
       ${lib.concatStringsSep "\n" (lib.mapAttrsToList activationSnippet config.boot.binfmt.registrations)}
     '';
-    systemd.additionalUpstreamSystemUnits = lib.mkIf (config.boot.binfmt.registrations != {})
-      [ "proc-sys-fs-binfmt_misc.automount"
-        "proc-sys-fs-binfmt_misc.mount"
-      ];
+    systemd.additionalUpstreamSystemUnits = lib.mkIf (config.boot.binfmt.registrations != {}) [
+      "proc-sys-fs-binfmt_misc.automount"
+      "proc-sys-fs-binfmt_misc.mount"
+      "systemd-binfmt.service"
+    ];
   };
 }
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix
index 7c4dc93e2fb..99892a28115 100644
--- a/nixos/modules/system/boot/systemd.nix
+++ b/nixos/modules/system/boot/systemd.nix
@@ -164,7 +164,6 @@ let
       "systemd-timedated.service"
       "systemd-localed.service"
       "systemd-hostnamed.service"
-      "systemd-binfmt.service"
       "systemd-exit.service"
       "systemd-update-done.service"
     ] ++ optionals config.services.journald.enableHttpGateway [
@@ -1056,7 +1055,6 @@ in
     systemd.targets.local-fs.unitConfig.X-StopOnReconfiguration = true;
     systemd.targets.remote-fs.unitConfig.X-StopOnReconfiguration = true;
     systemd.targets.network-online.wantedBy = [ "multi-user.target" ];
-    systemd.services.systemd-binfmt.wants = [ "proc-sys-fs-binfmt_misc.mount" ];
     systemd.services.systemd-importd.environment = proxy_env;
 
     # Don't bother with certain units in containers.