use execstart for update service

This commit is contained in:
Noa Aarts 2025-05-09 09:30:12 +02:00
parent 390cdd8fae
commit 40c48532b6
Signed by: noa
GPG key ID: 1850932741EFF672
2 changed files with 5 additions and 9 deletions

View file

@ -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"