From c178fe4bbb9e55f2a67260238b975264497d0f9a Mon Sep 17 00:00:00 2001 From: Niklas Hambüchen Date: Sat, 31 Oct 2020 16:50:25 +0100 Subject: nixos/modules: Reformat `warnings` section --- nixos/modules/system/boot/systemd.nix | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'nixos/modules/system/boot/systemd.nix') diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index a8ff5614862..a66176aff45 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; -- cgit 1.4.1