[NixOS] Allow retries of import key

This commit is contained in:
Ivan Malison 2023-08-22 18:07:27 -06:00
parent fa18612685
commit 723fc19aec

View File

@ -11,11 +11,16 @@
Unit = { Unit = {
Description = "Import GPG private key"; Description = "Import GPG private key";
After = [ "agenix.service" ]; After = [ "agenix.service" ];
# 3 total retries
StartLimitIntervalSec = 0;
StartLimitBurst = 3;
}; };
Install.WantedBy = [ "default.target" ]; Install.WantedBy = [ "default.target" ];
Service = { Service = {
Type = "oneshot"; Type = "oneshot";
RestartSec = 5;
Restart = "onfailure";
ExecStart = ExecStart =
let path = config.age.secrets.gpg-keys.path; let path = config.age.secrets.gpg-keys.path;
in "${pkgs.gnupg}/bin/gpg --batch --import ${path}"; in "${pkgs.gnupg}/bin/gpg --batch --import ${path}";