From 09ba8d459c23d9465567b52ae62e3a2415fedcc5 Mon Sep 17 00:00:00 2001 From: Tasia Iso Date: Fri, 7 Jun 2024 18:27:05 +0200 Subject: [PATCH] autoupgrade ok ? --- common/services/autoupgrade.nix | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/common/services/autoupgrade.nix b/common/services/autoupgrade.nix index ff58366..f82c5f8 100644 --- a/common/services/autoupgrade.nix +++ b/common/services/autoupgrade.nix @@ -13,25 +13,35 @@ systemd.services."nix-auto-upgrade" = { enable = true; - unitConfig = { - After="network-online.target"; - Description="NixOS Upgrade"; - Wants="network-online.target"; - # X-StopOnRemoval=false; ? - }; + + description = "NixOS Upgrade"; + + restartIfChanged = false; + unitConfig.X-StopOnRemoval = false; + + after = ["network-online.target"]; + wants = ["network-online.target"]; + serviceConfig = { Type = "oneshot"; User = "root"; WorkingDirectory = /etc/nixos/nixos-config; - - # X-RestartIfChanged=false; ? }; + path = with pkgs; [ + coreutils + gnutar + xz.bin + gzip + gitMinimal + # curl + ]; + script = '' set -eu ${pkgs.nixos-rebuild}/bin/nixos-rebuild switch -L --flake git+https://gitea.com/tasiaiso/nixos-config --upgrade - + ${pkgs.curl}/bin/curl \ -H "Title: NixOS upgrade done" \ -H "Priority: low" \