From 723fc19aecd603df9296e3bd1bd370feb7ee0deb Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 22 Aug 2023 18:07:27 -0600 Subject: [PATCH] [NixOS] Allow retries of import key --- nixos/secrets.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nixos/secrets.nix b/nixos/secrets.nix index 320787ba..3d47525e 100644 --- a/nixos/secrets.nix +++ b/nixos/secrets.nix @@ -11,11 +11,16 @@ Unit = { Description = "Import GPG private key"; After = [ "agenix.service" ]; + # 3 total retries + StartLimitIntervalSec = 0; + StartLimitBurst = 3; }; Install.WantedBy = [ "default.target" ]; Service = { Type = "oneshot"; + RestartSec = 5; + Restart = "onfailure"; ExecStart = let path = config.age.secrets.gpg-keys.path; in "${pkgs.gnupg}/bin/gpg --batch --import ${path}";