diff options
author | Niklas Hambüchen <mail@nh2.me> | 2020-10-31 16:50:25 +0100 |
---|---|---|
committer | Niklas Hambüchen <mail@nh2.me> | 2020-10-31 16:50:25 +0100 |
commit | c178fe4bbb9e55f2a67260238b975264497d0f9a (patch) | |
tree | d91476d14a47053b62d5f35475b7ed4a81e7ce9e /nixos | |
parent | b37bbca521556d30e564896eea56b41d63324fdf (diff) |
nixos/modules: Reformat `warnings` section
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/system/boot/systemd.nix | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index a8ff5614862b5..a66176aff45ff 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -886,14 +886,21 @@ in config = { - warnings = concatLists (mapAttrsToList (name: service: - let - type = service.serviceConfig.Type or ""; - restart = service.serviceConfig.Restart or "no"; - in optional - (type == "oneshot" && (restart == "always" || restart == "on-success")) - "Service '${name}.service' with 'Type=oneshot' cannot have 'Restart=always' or 'Restart=on-success'") - cfg.services); + warnings = concatLists ( + mapAttrsToList + (name: service: + let + type = service.serviceConfig.Type or ""; + restart = service.serviceConfig.Restart or "no"; + in + concatLists [ + (optional (type == "oneshot" && (restart == "always" || restart == "on-success")) + "Service '${name}.service' with 'Type=oneshot' cannot have 'Restart=always' or 'Restart=on-success'" + ) + ] + ) + cfg.services + ); system.build.units = cfg.units; |