From 332d0274710bbf4487389d67f6d865b711830243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= Date: Tue, 3 May 2022 22:44:29 +0200 Subject: [PATCH] feat(system): enable auto upgrades --- system/default.nix | 13 +++++++++++-- system/nix.nix | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/system/default.nix b/system/default.nix index fb3733f..7a1415c 100644 --- a/system/default.nix +++ b/system/default.nix @@ -1,6 +1,7 @@ -{ config, pkgs, ... }: +{ config, pkgs, lib, inputs, ... }: -{ +let flakes = lib.filterAttrs (name: value: value ? outputs) inputs; +in { imports = [ ./hardened.nix ./sound.nix @@ -35,4 +36,12 @@ services.printing.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); + }; } diff --git a/system/nix.nix b/system/nix.nix index f4e646e..b59e61f 100644 --- a/system/nix.nix +++ b/system/nix.nix @@ -3,7 +3,7 @@ { nix.gc = { automatic = true; - dates = "10:00"; + dates = "04:00"; options = "--delete-older-than 30d"; };