summary refs log tree commit diff
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-10-17 16:11:56 +0200
committerKarel Kočí <cynerd@email.cz>2022-10-17 16:11:56 +0200
commit76e1e908c1cbcf54b5a328af6e62a483f0637a60 (patch)
tree4786e4b681c4fc74257775c2e3142f16943d4369
parent44f236e33f44e986d3c0073afabbc9a1bf63fe2b (diff)
downloadnixpkgs-76e1e908c1cbcf54b5a328af6e62a483f0637a60.tar
nixpkgs-76e1e908c1cbcf54b5a328af6e62a483f0637a60.tar.gz
nixpkgs-76e1e908c1cbcf54b5a328af6e62a483f0637a60.tar.bz2
nixpkgs-76e1e908c1cbcf54b5a328af6e62a483f0637a60.tar.lz
nixpkgs-76e1e908c1cbcf54b5a328af6e62a483f0637a60.tar.xz
nixpkgs-76e1e908c1cbcf54b5a328af6e62a483f0637a60.tar.zst
nixpkgs-76e1e908c1cbcf54b5a328af6e62a483f0637a60.zip
nixos/modules/virtualisation: fix oci-containers with docker
The empty attribute set is invalidly provided as service config and
results in evaluation error.
-rw-r--r--nixos/modules/virtualisation/oci-containers.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/nixos/modules/virtualisation/oci-containers.nix b/nixos/modules/virtualisation/oci-containers.nix
index 36a28efc6ce..61066c3cbd7 100644
--- a/nixos/modules/virtualisation/oci-containers.nix
+++ b/nixos/modules/virtualisation/oci-containers.nix
@@ -304,12 +304,13 @@ let
       # ExecReload = ...;
       ###
 
-      Environment=if cfg.backend == "podman" then "PODMAN_SYSTEMD_UNIT=podman-${name}.service" else {};
-      Type=if cfg.backend == "podman" then "notify" else {};
-      NotifyAccess=if cfg.backend == "podman" then "all" else {};
       TimeoutStartSec = 0;
       TimeoutStopSec = 120;
       Restart = "always";
+    } // optionalAttrs (cfg.backend == "podman") {
+      Environment="PODMAN_SYSTEMD_UNIT=podman-${name}.service";
+      Type="notify";
+      NotifyAccess="all";
     };
   };