fix nixos-rebuild commands for systemd services

This commit is contained in:
Alexander Tomokhov 2023-11-21 07:10:41 +04:00
parent e1847e1ce8
commit d3873119b0

View file

@ -112,7 +112,7 @@ in
path = [ pkgs.coreutils pkgs.gnutar pkgs.xz.bin pkgs.gzip pkgs.gitMinimal config.nix.package.out pkgs.nixos-rebuild ];
serviceConfig = {
User = "root";
ExecStart = "${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake /etc/nixos";
ExecStart = "${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake /etc/nixos#sp-nixos";
KillMode = "none";
SendSIGKILL = "no";
};
@ -131,7 +131,7 @@ in
};
script = ''
${pkgs.nix}/bin/nix flake lock --override-input selfprivacy-nixos-config "git+https://git.selfprivacy.org/SelfPrivacy/selfprivacy-nixos-config.git?ref=flakes"
${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake /etc/nixos
${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake /etc/nixos#sp-nixos
'';
};
# One shot systemd service to rollback NixOS using nixos-rebuild
@ -143,7 +143,7 @@ in
path = [ pkgs.coreutils pkgs.gnutar pkgs.xz.bin pkgs.gzip pkgs.gitMinimal config.nix.package.out pkgs.nixos-rebuild ];
serviceConfig = {
User = "root";
ExecStart = "${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --rollback --flake /etc/nixos";
ExecStart = "${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --rollback --flake /etc/nixos#sp-nixos";
KillMode = "none";
SendSIGKILL = "no";
};