diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-04-17 18:52:31 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-04-17 18:52:31 +0200 |
commit | 179acfb664ed06519ac515eada7bbef677cbee87 (patch) | |
tree | 76c599294fe8ce8530b92c8a36f9b2adc7ee0595 /nixos/modules/services/misc/nix-daemon.nix | |
parent | 8dcf76480c34520997816d1bf4cfd68c6280ebbd (diff) | |
download | nixpkgs-179acfb664ed06519ac515eada7bbef677cbee87.tar nixpkgs-179acfb664ed06519ac515eada7bbef677cbee87.tar.gz nixpkgs-179acfb664ed06519ac515eada7bbef677cbee87.tar.bz2 nixpkgs-179acfb664ed06519ac515eada7bbef677cbee87.tar.lz nixpkgs-179acfb664ed06519ac515eada7bbef677cbee87.tar.xz nixpkgs-179acfb664ed06519ac515eada7bbef677cbee87.tar.zst nixpkgs-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/nix-daemon.nix')
-rw-r--r-- | nixos/modules/services/misc/nix-daemon.nix | 20 |
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 1516736dc2e..e6528777c32 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; }; |