From 55b0101dfff9d592f22d3d1daf0c6ffcd4e1bf28 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Sun, 29 Mar 2020 19:59:52 +0200 Subject: [PATCH] nixos/acme: don't depend on multi-user.target inside a container On boot, a container doesn't have an uplink and would run into a timeout while waiting for cert renewal[1]. [1] https://github.com/NixOS/nixpkgs/pull/81371#issuecomment-605526099 (cherry picked from commit 1a5289f80367629e8bc784ef41d4c63c542316cf) --- nixos/modules/security/acme.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/security/acme.nix b/nixos/modules/security/acme.nix index 774a5f983af6..a86b17a4ba8c 100644 --- a/nixos/modules/security/acme.nix +++ b/nixos/modules/security/acme.nix @@ -294,7 +294,7 @@ in description = "Renew ACME Certificate for ${cert}"; after = [ "network.target" "network-online.target" ]; wants = [ "network-online.target" ]; - wantedBy = [ "multi-user.target" ]; + wantedBy = mkIf (!config.boot.isContainer) [ "multi-user.target" ]; serviceConfig = { Type = "oneshot"; # With RemainAfterExit the service is considered active even