From 40c48532b6ddf5d4a3167f57f2b157eb1e349c39 Mon Sep 17 00:00:00 2001 From: Noa Aarts Date: Fri, 9 May 2025 09:30:12 +0200 Subject: [PATCH] use execstart for update service --- hosts/muos/configuration.nix | 5 ++--- hosts/nuos/configuration.nix | 9 +++------ 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/hosts/muos/configuration.nix b/hosts/muos/configuration.nix index 0f041d4..dd62d87 100644 --- a/hosts/muos/configuration.nix +++ b/hosts/muos/configuration.nix @@ -70,13 +70,12 @@ services."update-from-flake" = { path = with pkgs; [ - nixos-rebuild git ]; - script = ''nixos-rebuild switch --flake github:itepastra/nixconf''; serviceConfig = { - Type = "oneshot"; + Type = "exec"; User = "root"; + ExecStart = "${pkgs.nixos-rebuild-ng}/bin/nixos-rebuild switch --flake github:itepastra/nixconf"; }; wants = [ "network-online.target" diff --git a/hosts/nuos/configuration.nix b/hosts/nuos/configuration.nix index 0b38dd4..817423b 100644 --- a/hosts/nuos/configuration.nix +++ b/hosts/nuos/configuration.nix @@ -117,16 +117,13 @@ in systemd.services = { "update-from-flake" = { path = with pkgs; [ - nixos-rebuild git ]; - script = '' - nixos-rebuild boot --flake github:itepastra/nixconf#nuOS - shutdown -r +5 "System will reboot in 5 minutes" - ''; serviceConfig = { - Type = "oneshot"; + Type = "exec"; User = "root"; + ExecStart = "${pkgs.nixos-rebuild-ng}/bin/nixos-rebuild boot --flake github:itepastra/nixconf"; + ExecStopPost = ''shutdown -r +5 "Preparing update finished, rebooting..."''; }; wants = [ "network-online.target"