nixos/self-deploy: make systemd dependency conditional

As recommended in the discussion at #157883
This commit is contained in:
William Carroll 2022-02-03 11:32:27 -08:00 committed by sterni
parent 221959fbbd
commit e8ff81edb7

View File

@ -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