mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-24 13:01:28 +00:00
minimal updates to systemd services
This commit is contained in:
parent
e6e9d0677e
commit
e28aa8d60d
|
@ -105,45 +105,45 @@ in
|
||||||
};
|
};
|
||||||
# One shot systemd service to rebuild NixOS using nixos-rebuild
|
# One shot systemd service to rebuild NixOS using nixos-rebuild
|
||||||
systemd.services.sp-nixos-rebuild = {
|
systemd.services.sp-nixos-rebuild = {
|
||||||
description = "Upgrade NixOS using nixos-rebuild";
|
description = "nixos-rebuild switch";
|
||||||
environment = config.nix.envVars // {
|
environment = config.nix.envVars // {
|
||||||
inherit (config.environment.sessionVariables) NIX_PATH;
|
|
||||||
HOME = "/root";
|
HOME = "/root";
|
||||||
} // config.networking.proxy.envVars;
|
} // config.networking.proxy.envVars;
|
||||||
path = [ pkgs.coreutils pkgs.gnutar pkgs.xz.bin pkgs.gzip pkgs.gitMinimal config.nix.package.out pkgs.nixos-rebuild ];
|
path = [ pkgs.coreutils pkgs.gnutar pkgs.xz.bin pkgs.gzip pkgs.gitMinimal config.nix.package.out pkgs.nixos-rebuild ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = "root";
|
User = "root";
|
||||||
ExecStart = "${pkgs.nixos-rebuild}/bin/nixos-rebuild switch";
|
ExecStart = "${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --flake /etc/nixos";
|
||||||
KillMode = "none";
|
KillMode = "none";
|
||||||
SendSIGKILL = "no";
|
SendSIGKILL = "no";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
# One shot systemd service to upgrade NixOS using nixos-rebuild
|
# One shot systemd service to upgrade NixOS using nixos-rebuild
|
||||||
systemd.services.sp-nixos-upgrade = {
|
systemd.services.sp-nixos-upgrade = {
|
||||||
description = "Upgrade NixOS using nixos-rebuild";
|
description = "Upgrade NixOS to the latest base configuration";
|
||||||
environment = config.nix.envVars // {
|
environment = config.nix.envVars // {
|
||||||
inherit (config.environment.sessionVariables) NIX_PATH;
|
|
||||||
HOME = "/root";
|
HOME = "/root";
|
||||||
} // config.networking.proxy.envVars;
|
} // config.networking.proxy.envVars;
|
||||||
path = [ pkgs.coreutils pkgs.gnutar pkgs.xz.bin pkgs.gzip pkgs.gitMinimal config.nix.package.out pkgs.nixos-rebuild ];
|
path = [ pkgs.coreutils pkgs.gnutar pkgs.xz.bin pkgs.gzip pkgs.gitMinimal config.nix.package.out pkgs.nixos-rebuild ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = "root";
|
User = "root";
|
||||||
ExecStart = "${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --upgrade";
|
|
||||||
KillMode = "none";
|
KillMode = "none";
|
||||||
SendSIGKILL = "no";
|
SendSIGKILL = "no";
|
||||||
};
|
};
|
||||||
|
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
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
# One shot systemd service to rollback NixOS using nixos-rebuild
|
# One shot systemd service to rollback NixOS using nixos-rebuild
|
||||||
systemd.services.sp-nixos-rollback = {
|
systemd.services.sp-nixos-rollback = {
|
||||||
description = "Rollback NixOS using nixos-rebuild";
|
description = "Rollback NixOS using nixos-rebuild";
|
||||||
environment = config.nix.envVars // {
|
environment = config.nix.envVars // {
|
||||||
inherit (config.environment.sessionVariables) NIX_PATH;
|
|
||||||
HOME = "/root";
|
HOME = "/root";
|
||||||
} // config.networking.proxy.envVars;
|
} // config.networking.proxy.envVars;
|
||||||
path = [ pkgs.coreutils pkgs.gnutar pkgs.xz.bin pkgs.gzip pkgs.gitMinimal config.nix.package.out pkgs.nixos-rebuild ];
|
path = [ pkgs.coreutils pkgs.gnutar pkgs.xz.bin pkgs.gzip pkgs.gitMinimal config.nix.package.out pkgs.nixos-rebuild ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
User = "root";
|
User = "root";
|
||||||
ExecStart = "${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --rollback";
|
ExecStart = "${pkgs.nixos-rebuild}/bin/nixos-rebuild switch --rollback --flake /etc/nixos";
|
||||||
KillMode = "none";
|
KillMode = "none";
|
||||||
SendSIGKILL = "no";
|
SendSIGKILL = "no";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue