make all servers auto-upgrade
6 files changed, 41 insertions(+), 54 deletions(-)
M system/hosts/linde.nix → system/hosts/linde.nix
@@ -110,32 +110,6 @@ } ]; }; - systemd.services.update-nixfiles = { - startAt = config.system.autoUpgrade.dates; - wantedBy = [ "nixos-upgrade.service" ]; - path = with pkgs; [ - openssh - nix - config.git.package - ]; - serviceConfig = { - Type = "oneshot"; - User = "alin"; - WorkingDirectory = "${config.users.users.alin.home}/projects/alin.ovh/nixfiles"; - }; - script = '' - git checkout -- flake.lock - git pull --recurse-submodules=yes - nix flake update - ''; - }; - system.autoUpgrade = { - dates = "02:10"; - randomizedDelaySec = "59 min"; - allowReboot = true; - flake = "${config.systemd.services.update-nixfiles.serviceConfig.WorkingDirectory}?submodules=1"; - }; - networking = { hostName = hostname; inherit domain;@@ -213,7 +187,6 @@ services.cloud-init.network.enable = false; services.resolved = { enable = true; settings.Resolve = { - LLMNR = false; DNSSEC = true; }; };
M system/hosts/r5.nix → system/hosts/r5.nix
@@ -117,18 +117,6 @@ builders-use-substitutes = true; }; }; - system.autoUpgrade = { - enable = lib.mkForce false; - dates = "04:15"; - randomizedDelaySec = "59 min"; - flake = "git+https://git.alin.ovh/nixfiles"; - allowReboot = true; - rebootWindow = { - lower = "01:00"; - upper = "06:00"; - }; - }; - services.timesyncd.enable = false; services.chrony = { enable = true;
M system/hosts/r6.nix → system/hosts/r6.nix
@@ -403,17 +403,6 @@ ]; }; }; - system.autoUpgrade = { - dates = "04:15"; - randomizedDelaySec = "59 min"; - flake = "git+https://git.alanpearce.eu/nixfiles"; - allowReboot = true; - rebootWindow = { - lower = "01:00"; - upper = "06:00"; - }; - }; - users.users.syncthing = { isSystemUser = true; group = "syncthing";
M system/roles/server.nix → system/roles/server.nix
@@ -7,6 +7,7 @@ }: { imports = [ ../settings/configuration/nix-linux.nix + ../settings/configuration/auto-upgrade.nix ../settings/configuration/date-time.nix ../settings/configuration/locale.nix
A system/settings/configuration/auto-upgrade.nix
@@ -0,0 +1,40 @@ +{ + config, + pkgs, + ... +}: +{ + systemd.services.update-nixfiles = { + startAt = config.system.autoUpgrade.dates; + wantedBy = [ "nixos-upgrade.service" ]; + path = with pkgs; [ + openssh + nix + config.programs.git.package + ]; + serviceConfig = { + Type = "oneshot"; + User = "alin"; + WorkingDirectory = "${config.users.users.alin.home}/projects/alin.ovh/nixfiles"; + }; + script = '' + git checkout -- flake.lock + git pull --recurse-submodules=yes + nix flake update + ''; + }; + + system.autoUpgrade = { + enable = true; + allowReboot = true; + + dates = "02:10"; + randomizedDelaySec = "59 min"; + rebootWindow = { + lower = "01:00"; + upper = "06:00"; + }; + + flake = "${config.systemd.services.update-nixfiles.serviceConfig.WorkingDirectory}?submodules=1"; + }; +}
M system/settings/configuration/nix-linux.nix → system/settings/configuration/nix-linux.nix
@@ -15,8 +15,4 @@ nixpkgs.config.allowUnfree = true; services.angrr.enableNixGcIntegration = true; - - system.autoUpgrade = { - enable = true; - }; }