about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorIlan Joselevich <personal@ilanjoselevich.com>2023-07-07 17:29:05 +0300
committerIlan Joselevich <personal@ilanjoselevich.com>2023-07-07 17:29:05 +0300
commitaf8206f8011d8568d34d19428e288b7ebaa4d36b (patch)
tree186ed05cbccb5edc61b6568281ffa16a8528d393 /nixos
parent73d174c62ba412c79358895282b6ecee9497469a (diff)
nixos/nix-daemon: use tmpfiles from nixPackage when possible
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/system/nix-daemon.nix15
1 files changed, 8 insertions, 7 deletions
diff --git a/nixos/modules/services/system/nix-daemon.nix b/nixos/modules/services/system/nix-daemon.nix
index ad86a567b7af6..0d6bec888395e 100644
--- a/nixos/modules/services/system/nix-daemon.nix
+++ b/nixos/modules/services/system/nix-daemon.nix
@@ -168,13 +168,14 @@ in
 
     systemd.packages = [ nixPackage ];
 
-    # Will only work once https://github.com/NixOS/nix/pull/6285 is merged
-    # systemd.tmpfiles.packages = [ nixPackage ];
-
-    # Can be dropped for Nix > https://github.com/NixOS/nix/pull/6285
-    systemd.tmpfiles.rules = [
-      "d /nix/var/nix/daemon-socket 0755 root root - -"
-    ];
+    systemd.tmpfiles =
+      if (isNixAtLeast "2.8") then {
+        packages = [ nixPackage ];
+      } else {
+        rules = [
+          "d /nix/var/nix/daemon-socket 0755 root root - -"
+        ];
+      };
 
     systemd.sockets.nix-daemon.wantedBy = [ "sockets.target" ];