nixos/self-deploy: make systemd dependency conditional

As recommended in the discussion at #157883
This commit is contained in:
William Carroll
2022-02-04 10:59:24 +01:00
committed by sterni
parent 221959fbbd
commit e8ff81edb7
@@ -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