use execstart for update service
This commit is contained in:
parent
390cdd8fae
commit
40c48532b6
2 changed files with 5 additions and 9 deletions
|
|
@ -70,13 +70,12 @@
|
||||||
|
|
||||||
services."update-from-flake" = {
|
services."update-from-flake" = {
|
||||||
path = with pkgs; [
|
path = with pkgs; [
|
||||||
nixos-rebuild
|
|
||||||
git
|
git
|
||||||
];
|
];
|
||||||
script = ''nixos-rebuild switch --flake github:itepastra/nixconf'';
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "exec";
|
||||||
User = "root";
|
User = "root";
|
||||||
|
ExecStart = "${pkgs.nixos-rebuild-ng}/bin/nixos-rebuild switch --flake github:itepastra/nixconf";
|
||||||
};
|
};
|
||||||
wants = [
|
wants = [
|
||||||
"network-online.target"
|
"network-online.target"
|
||||||
|
|
|
||||||
|
|
@ -117,16 +117,13 @@ in
|
||||||
systemd.services = {
|
systemd.services = {
|
||||||
"update-from-flake" = {
|
"update-from-flake" = {
|
||||||
path = with pkgs; [
|
path = with pkgs; [
|
||||||
nixos-rebuild
|
|
||||||
git
|
git
|
||||||
];
|
];
|
||||||
script = ''
|
|
||||||
nixos-rebuild boot --flake github:itepastra/nixconf#nuOS
|
|
||||||
shutdown -r +5 "System will reboot in 5 minutes"
|
|
||||||
'';
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "oneshot";
|
Type = "exec";
|
||||||
User = "root";
|
User = "root";
|
||||||
|
ExecStart = "${pkgs.nixos-rebuild-ng}/bin/nixos-rebuild boot --flake github:itepastra/nixconf";
|
||||||
|
ExecStopPost = ''shutdown -r +5 "Preparing update finished, rebooting..."'';
|
||||||
};
|
};
|
||||||
wants = [
|
wants = [
|
||||||
"network-online.target"
|
"network-online.target"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue