fix(system): ignore seven-modules in nixos-upgrade's flake updates

Prevents nixos-upgrade from failing due to interactive git authorization.
This commit is contained in:
Felix Schröter 2025-06-08 22:58:04 +02:00
parent 4ebc3d6664
commit 7d3f467586
Signed by: felschr
GPG key ID: 671E39E6744C807D

View file

@ -2,6 +2,7 @@
inputs,
config,
pkgs,
lib,
...
}:
@ -37,7 +38,16 @@ in
config.safe.directory = [ "/etc/nixos" ];
};
systemd.services.nixos-upgrade.preStart = ''
nix flake update --flake ${config.system.autoUpgrade.flake}
'';
systemd.services.nixos-upgrade.preStart =
let
inputsToIgnore = [
"self"
"seven-modules"
];
inputsToUpdate = lib.filter (i: !(lib.elem i inputsToIgnore)) (lib.attrNames inputs);
inputsToUpdateStr = lib.concatStringsSep " " inputsToUpdate;
in
''
nix flake update ${inputsToUpdateStr} --flake ${config.system.autoUpgrade.flake}
'';
}