From e8ff81edb79b433f6574c4866b2ebfde4888f950 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Thu, 3 Feb 2022 11:32:27 -0800 Subject: nixos/self-deploy: make systemd dependency conditional As recommended in the discussion at #157883 --- nixos/modules/services/system/self-deploy.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/nixos/modules/services/system/self-deploy.nix b/nixos/modules/services/system/self-deploy.nix index 6224c8f748e..d7130a13c73 100644 --- a/nixos/modules/services/system/self-deploy.nix +++ b/nixos/modules/services/system/self-deploy.nix @@ -126,9 +126,9 @@ in config = lib.mkIf cfg.enable { systemd.services.self-deploy = { - wantedBy = [ "multi-user.target" ]; + inherit (cfg) startAt; - startAt = cfg.startAt; + wantedBy = [ "multi-user.target" ]; requires = lib.mkIf (!(isPathType cfg.repository)) [ "network-online.target" ]; @@ -140,8 +140,7 @@ in path = with pkgs; [ git nix - systemd - ]; + ] ++ lib.optionals (cfg.switchCommand == "boot") [ systemd ]; script = '' if [ ! -e ${repositoryDirectory} ]; then -- cgit 1.4.1