diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-03-12 18:35:50 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-03-12 18:52:11 +0100 |
commit | 207c881df9a8786323516908ca21885aa7f6138a (patch) | |
tree | 89ef0bce6b36d10a7691d28b85ce36982cae9702 /nixos/modules/system/boot | |
parent | d4122456016accdc2137c383bf7b40e6c016dd19 (diff) | |
download | nixpkgs-207c881df9a8786323516908ca21885aa7f6138a.tar nixpkgs-207c881df9a8786323516908ca21885aa7f6138a.tar.gz nixpkgs-207c881df9a8786323516908ca21885aa7f6138a.tar.bz2 nixpkgs-207c881df9a8786323516908ca21885aa7f6138a.tar.lz nixpkgs-207c881df9a8786323516908ca21885aa7f6138a.tar.xz nixpkgs-207c881df9a8786323516908ca21885aa7f6138a.tar.zst nixpkgs-207c881df9a8786323516908ca21885aa7f6138a.zip |
Don't include superfluous lines in generated units
Diffstat (limited to 'nixos/modules/system/boot')
-rw-r--r-- | nixos/modules/system/boot/systemd-unit-options.nix | 1 | ||||
-rw-r--r-- | nixos/modules/system/boot/systemd.nix | 26 |
2 files changed, 18 insertions, 9 deletions
diff --git a/nixos/modules/system/boot/systemd-unit-options.nix b/nixos/modules/system/boot/systemd-unit-options.nix index 4163696c53d..113990814ef 100644 --- a/nixos/modules/system/boot/systemd-unit-options.nix +++ b/nixos/modules/system/boot/systemd-unit-options.nix @@ -141,6 +141,7 @@ in rec { restartTriggers = mkOption { default = []; + type = types.listOf types.unspecified; description = '' An arbitrary list of items such as derivations. If any item in the list changes between reconfigurations, the service will diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 7bff08d50d9..e9d25479378 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -145,15 +145,23 @@ let unitConfig = { name, config, ... }: { config = { unitConfig = - { Requires = concatStringsSep " " config.requires; - Wants = concatStringsSep " " config.wants; - After = concatStringsSep " " config.after; - Before = concatStringsSep " " config.before; - BindsTo = concatStringsSep " " config.bindsTo; - PartOf = concatStringsSep " " config.partOf; - Conflicts = concatStringsSep " " config.conflicts; - X-Restart-Triggers = toString config.restartTriggers; - } // optionalAttrs (config.description != "") { + optionalAttrs (config.requires != []) + { Requires = toString config.requires; } + // optionalAttrs (config.wants != []) + { Wants = toString config.wants; } + // optionalAttrs (config.after != []) + { After = toString config.after; } + // optionalAttrs (config.before != []) + { Before = toString config.before; } + // optionalAttrs (config.bindsTo != []) + { BindsTo = toString config.bindsTo; } + // optionalAttrs (config.partOf != []) + { PartOf = toString config.partOf; } + // optionalAttrs (config.conflicts != []) + { Conflicts = toString config.conflicts; } + // optionalAttrs (config.restartTriggers != []) + { X-Restart-Triggers = toString config.restartTriggers; } + // optionalAttrs (config.description != "") { Description = config.description; }; }; |