move home-manager update to auto-upgrade module
2 files changed, 20 insertions(+), 18 deletions(-)
M system/roles/server.nix → system/roles/server.nix
@@ -36,27 +36,11 @@ services.sshguard = { enable = true; }; + systemd.services.home-manager-update.enable = true; + services.journald.extraConfig = '' MaxRetentionSec=1 month ''; - - systemd.services.update-home-manager = - let - nixfiles = lib.removePrefix "-" config.systemd.services.update-nixfiles.serviceConfig.WorkingDirectory; - in - { - startAt = "weekly"; - path = with pkgs; [ - openssh - nix - config.programs.git.package - ]; - serviceConfig = rec { - Type = "oneshot"; - User = "alin"; - ExecStart = "${lib.getExe pkgs.nh} home switch --file ${nixfiles} homeConfigurations.${User}@%H --no-nom"; - }; - }; services.syncthing = { dataDir = "/srv/syncthing";
M system/settings/configuration/auto-upgrade.nix → system/settings/configuration/auto-upgrade.nix
@@ -1,6 +1,7 @@ { config, lib, + pkgs, ... }: let@@ -27,6 +28,23 @@ git checkout -- flake.lock git pull --recurse-submodules=yes fi ''; + }; + + systemd.services.home-manager-update = { + enable = lib.mkDefault false; + startAt = "weekly"; + wants = [ "update-nixfiles.service" ]; + path = with pkgs; [ + openssh + nix + config.programs.git.package + ]; + serviceConfig = rec { + Type = "oneshot"; + User = "alin"; + WorkingDirectory = nixfiles; + ExecStart = "${lib.getExe pkgs.nh} home switch --file . homeConfigurations.${User}@%H --no-nom"; + }; }; system.autoUpgrade = {