feat(system): enable auto upgrades

This commit is contained in:
Felix Schröter 2022-05-03 22:44:29 +02:00
parent 29a8def572
commit 332d027471
Signed by: felschr
GPG key ID: 671E39E6744C807D
2 changed files with 12 additions and 3 deletions

View file

@ -1,6 +1,7 @@
{ config, pkgs, ... }: { config, pkgs, lib, inputs, ... }:
{ let flakes = lib.filterAttrs (name: value: value ? outputs) inputs;
in {
imports = [ imports = [
./hardened.nix ./hardened.nix
./sound.nix ./sound.nix
@ -35,4 +36,12 @@
services.printing.enable = true; services.printing.enable = true;
services.fwupd.enable = true; services.fwupd.enable = true;
system.autoUpgrade = {
enable = true;
dates = "02:00";
flake = "/etc/nixos";
flags = with lib;
flatten (mapAttrsToList (n: _: [ "--update-input" n ]) flakes);
};
} }

View file

@ -3,7 +3,7 @@
{ {
nix.gc = { nix.gc = {
automatic = true; automatic = true;
dates = "10:00"; dates = "04:00";
options = "--delete-older-than 30d"; options = "--delete-older-than 30d";
}; };