Abstract autoUpgrade to separate file

Enable autoUpgrade for desktops (as well as server of course)
This commit is contained in:
Evie Litherland-Smith 2024-01-07 12:44:16 +00:00
parent d4f5b1f925
commit 9e81dac00a
5 changed files with 26 additions and 8 deletions

View file

@ -22,6 +22,7 @@
group = "users";
shell = "zsh";
systemModules = [ ./system/hyprland.nix ];
serviceModules = [ ];
homeModules = [
./home/default.nix
./home/emacs.nix
@ -33,7 +34,8 @@
};
systemConfig = { hostName ? default.hostName, user ? default.user
, system ? default.system, group ? default.group, shell ? default.shell
, systemModules ? default.systemModules, serviceModules ? [ ]
, systemModules ? default.systemModules
, serviceModules ? default.serviceModules
, homeModules ? default.homeModules, stateVersion ? default.stateVersion
}:
let specialArgs = { inherit hostName user; };
@ -209,13 +211,15 @@
in {
nixosConfigurations = {
## Server
Legion = let
hostName = "Legion";
user = "xenia";
system = "x86_64-linux";
in systemConfig {
inherit hostName user system;
systemModules = [ ./system/default.nix ];
systemModules = [ ./system/default.nix ./system/autoupgrade.nix ];
serviceModules = [
./services/adguardhome.nix
./services/caddy.nix
@ -229,6 +233,8 @@
homeModules = [ ./home/default.nix ];
};
## Laptops
Northstar = let
hostName = "Northstar";
user = "xenia";
@ -241,11 +247,16 @@
system = "x86_64-linux";
in systemConfig { inherit hostName user system; };
## Desktops
Scorch = let
hostName = "Scorch";
user = "elitherl";
system = "x86_64-linux";
in systemConfig { inherit hostName user system; };
in systemConfig {
inherit hostName user system;
systemModules = default.systemModules ++ [ ./system/autoupgrade.nix ];
};
Vanguard = let
hostName = "Vanguard";
@ -253,7 +264,8 @@
system = "x86_64-linux";
in systemConfig {
inherit hostName user system;
systemModules = default.systemModules ++ [ ./system/steam.nix ];
systemModules = default.systemModules
++ [ ./system/autoupgrade.nix ./system/steam.nix ];
homeModules = default.homeModules ++ [ ./home/games/default.nix ];
};

View file

@ -1,11 +1,9 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running `nixos-help`).
{ lib, ... }: {
{ ... }: {
users.mutableUsers = false;
system.autoUpgrade = {
enable = true;
flake = "git+https://git.xenia.me.uk/xenia/nixos.git?ref=main";
dates = "02:30";
allowReboot = true;
rebootWindow = {

View file

@ -14,4 +14,6 @@
'';
systemPackages = with pkgs; [ openfortivpn samba nomachine-client ];
};
system.autoUpgrade.allowReboot = false;
}

View file

@ -1 +1 @@
{ ... }: { }
{ ... }: { system.autoUpgrade.allowReboot = false; }

6
system/autoupgrade.nix Normal file
View file

@ -0,0 +1,6 @@
{ ... }: {
system.autoUpgrade = {
enable = true;
flake = "git+https://git.xenia.me.uk/xenia/nixos.git?ref=main";
};
}