Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chore] Add systemd unit restart policy #34

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions modules/vault-secrets.nix
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# SPDX-FileCopyrightText: 2020 Serokell <https://serokell.io/>
# SPDX-FileCopyrightText: 2020-2023 Serokell <https://serokell.io/>
#
# SPDX-License-Identifier: MPL-2.0

{ config, lib, pkgs, ... }:
let
cfg = config.vault-secrets;
inherit (lib) mkMerge flip mapAttrs' nameValuePair optional;
inherit (lib) mkMerge mkDefault flip mapAttrs' nameValuePair optional;
in
{
options = import ./options.nix { inherit lib cfg pkgs; };
Expand All @@ -26,11 +26,16 @@ in

script = import ./script.nix { inherit cfg scfg lib name; };

startLimitBurst = mkDefault 5;
startLimitIntervalSec = mkDefault 300;

serviceConfig = {
EnvironmentFile = scfg.environmentFile;
RemainAfterExit = true;
Type = "oneshot";
UMask = "0077";
Restart = mkDefault "on-failure";
RestartSec = mkDefault 10;
};
}
))] ++ (flip lib.mapAttrsToList cfg.secrets (
Expand Down