Merge pull request #233423 from tomaskala/self-deploy-after-network-online

nixos/self-deploy: set after to requires, type to oneshot and remove wantedBy
This commit is contained in:
Sandro 2023-06-05 19:47:10 +02:00 committed by GitHub
commit 048f167595
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -125,13 +125,15 @@ in
};
config = lib.mkIf cfg.enable {
systemd.services.self-deploy = {
systemd.services.self-deploy = rec {
inherit (cfg) startAt;
wantedBy = [ "multi-user.target" ];
serviceConfig.Type = "oneshot";
requires = lib.mkIf (!(isPathType cfg.repository)) [ "network-online.target" ];
after = requires;
environment.GIT_SSH_COMMAND = lib.mkIf (cfg.sshKeyFile != null)
"${pkgs.openssh}/bin/ssh -i ${lib.escapeShellArg cfg.sshKeyFile}";