From 1c82b2c92e42b38d0c3c61ff4a0f5f89db08e52a Mon Sep 17 00:00:00 2001 From: jopejoe1 Date: Fri, 12 Jul 2024 13:43:11 +0200 Subject: [PATCH] infra: fix systemd service --- nix/infra/backend.nix | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/nix/infra/backend.nix b/nix/infra/backend.nix index 833e220..bd7b195 100644 --- a/nix/infra/backend.nix +++ b/nix/infra/backend.nix @@ -33,22 +33,25 @@ in systemd.services.public-pw-reset = { enable = true; description = "Rest Public Password"; + script = '' + /root/fixpw.sh + ''; + path = [ + pkgs.curl + pkgs.bash + ]; serviceConfig = { User = "root"; - script = '' - /root/fixpw.sh - ''; + Type = "oneshot"; }; }; - systemd.timers.public-pw-reset = { - enable = true; - description = "Rest Public Password"; - wants = [ "public-pw-reset.service" ]; - wantedBy = [ "multi-user.target" ]; + systemd.timers.public-pw-reset = = { + wantedBy = [ "timers.target" ]; timerConfig = { - OnBootSec= "0min"; - OnCalendar = "*:0/1"; + OnBootSec = "5m"; + OnUnitActiveSec = "1m"; + Unit = "public-pw-reset.service"; }; };