summary refs log tree commit diff
path: root/nixos/modules/system/boot/systemd.nix
diff options
context:
space:
mode:
authorNiklas Hambüchen <mail@nh2.me>2020-10-31 16:50:25 +0100
committerNiklas Hambüchen <mail@nh2.me>2020-10-31 16:50:25 +0100
commitc178fe4bbb9e55f2a67260238b975264497d0f9a (patch)
treed91476d14a47053b62d5f35475b7ed4a81e7ce9e /nixos/modules/system/boot/systemd.nix
parentb37bbca521556d30e564896eea56b41d63324fdf (diff)
downloadnixpkgs-c178fe4bbb9e55f2a67260238b975264497d0f9a.tar
nixpkgs-c178fe4bbb9e55f2a67260238b975264497d0f9a.tar.gz
nixpkgs-c178fe4bbb9e55f2a67260238b975264497d0f9a.tar.bz2
nixpkgs-c178fe4bbb9e55f2a67260238b975264497d0f9a.tar.lz
nixpkgs-c178fe4bbb9e55f2a67260238b975264497d0f9a.tar.xz
nixpkgs-c178fe4bbb9e55f2a67260238b975264497d0f9a.tar.zst
nixpkgs-c178fe4bbb9e55f2a67260238b975264497d0f9a.zip
nixos/modules: Reformat `warnings` section
Diffstat (limited to 'nixos/modules/system/boot/systemd.nix')
-rw-r--r--nixos/modules/system/boot/systemd.nix23
1 files changed, 15 insertions, 8 deletions
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;