[NixOS] Wait for agenix to try to import gpg key

This commit is contained in:
Ivan Malison 2023-08-22 18:00:31 -06:00
parent 36b8e8d584
commit fa18612685

View File

@ -10,11 +10,15 @@
systemd.user.services.import-gpg-key = {
Unit = {
Description = "Import GPG private key";
After = [ "agenix.service" ];
};
Install.WantedBy = [ "default.target" ];
Service = {
Type = "oneshot";
ExecStart = "${pkgs.gnupg}/bin/gpg --batch --import /run/user/%U/agenix/gpg-keys";
ExecStart =
let path = config.age.secrets.gpg-keys.path;
in "${pkgs.gnupg}/bin/gpg --batch --import ${path}";
};
};
});