summary refs log tree commit diff
path: root/nixos/modules/services/misc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-17 18:52:31 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-17 18:52:31 +0200
commit179acfb664ed06519ac515eada7bbef677cbee87 (patch)
tree76c599294fe8ce8530b92c8a36f9b2adc7ee0595 /nixos/modules/services/misc
parent8dcf76480c34520997816d1bf4cfd68c6280ebbd (diff)
downloadnixlib-179acfb664ed06519ac515eada7bbef677cbee87.tar
nixlib-179acfb664ed06519ac515eada7bbef677cbee87.tar.gz
nixlib-179acfb664ed06519ac515eada7bbef677cbee87.tar.bz2
nixlib-179acfb664ed06519ac515eada7bbef677cbee87.tar.lz
nixlib-179acfb664ed06519ac515eada7bbef677cbee87.tar.xz
nixlib-179acfb664ed06519ac515eada7bbef677cbee87.tar.zst
nixlib-179acfb664ed06519ac515eada7bbef677cbee87.zip
Allow upstream systemd units to be extended
If you define a unit, and either systemd or a package in
systemd.packages already provides that unit, then we now generate a
file /etc/systemd/system/<unit>.d/overrides.conf. This makes it
possible to use upstream units, while allowing them to be customised
from the NixOS configuration. For instance, the module nix-daemon.nix
now uses the units provided by the Nix package. And all unit
definitions that duplicated upstream systemd units are finally gone.

This makes the baseUnit option unnecessary, so I've removed it.
Diffstat (limited to 'nixos/modules/services/misc')
-rw-r--r--nixos/modules/services/misc/nix-daemon.nix20
1 files changed, 4 insertions, 16 deletions
diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix
index 1516736dc2e0..e6528777c325 100644
--- a/nixos/modules/services/misc/nix-daemon.nix
+++ b/nixos/modules/services/misc/nix-daemon.nix
@@ -275,28 +275,16 @@ in
           ) cfg.buildMachines;
       };
 
-    systemd.sockets."nix-daemon" =
-      { description = "Nix Daemon Socket";
-        wantedBy = [ "sockets.target" ];
-        before = [ "multi-user.target" ];
-        unitConfig.ConditionPathIsReadWrite = "/nix/var/nix/daemon-socket/";
-        socketConfig.ListenStream = "/nix/var/nix/daemon-socket/socket";
-      };
-
-    systemd.services."nix-daemon" =
-      { description = "Nix Daemon";
+    systemd.packages = [ nix ];
 
-        path = [ nix pkgs.openssl pkgs.utillinux pkgs.openssh ]
+    systemd.services.nix-daemon =
+      { path = [ nix pkgs.openssl pkgs.utillinux pkgs.openssh ]
           ++ optionals cfg.distributedBuilds [ pkgs.gzip ];
 
         environment = cfg.envVars // { CURL_CA_BUNDLE = "/etc/ssl/certs/ca-bundle.crt"; };
 
-        unitConfig.ConditionPathIsReadWrite = "/nix/var/nix/daemon-socket/";
-
         serviceConfig =
-          { ExecStart = "@${nix}/bin/nix-daemon nix-daemon --daemon";
-            KillMode = "process";
-            Nice = cfg.daemonNiceLevel;
+          { Nice = cfg.daemonNiceLevel;
             IOSchedulingPriority = cfg.daemonIONiceLevel;
             LimitNOFILE = 4096;
           };