2026-05-01 22:39:21 +02:00
|
|
|
{ lib, config, ... }:
|
2025-09-13 15:25:54 +02:00
|
|
|
{
|
2026-05-01 22:39:21 +02:00
|
|
|
options.my.autoupdate.enable = lib.mkEnableOption "automatic Nix GC and system upgrades";
|
|
|
|
|
|
|
|
|
|
config = lib.mkIf config.my.autoupdate.enable {
|
|
|
|
|
nix = {
|
|
|
|
|
optimise.automatic = true;
|
|
|
|
|
gc = {
|
|
|
|
|
automatic = true;
|
|
|
|
|
dates = "daily";
|
|
|
|
|
options = "--delete-older-than 7d";
|
|
|
|
|
};
|
2025-09-13 15:25:54 +02:00
|
|
|
};
|
|
|
|
|
|
2026-05-01 22:39:21 +02:00
|
|
|
system.autoUpgrade = {
|
|
|
|
|
enable = true;
|
|
|
|
|
dates = "daily";
|
|
|
|
|
# do not forget to set `flake` when using this module!
|
|
|
|
|
};
|
2025-09-13 15:25:54 +02:00
|
|
|
};
|
|
|
|
|
}
|