diff --git a/hosts/common/autoupdate.nix b/hosts/common/autoupdate.nix new file mode 100644 index 0000000..c5591ef --- /dev/null +++ b/hosts/common/autoupdate.nix @@ -0,0 +1,11 @@ +{ pkgs, ... }: +{ + system.autoUpgrade = { + enable = true; + dates = "04:00"; + flake = "https://git.huwe.mooo.com/willifan/nix-config.git"; + persistent = true; + randomizedDelaySec = "5min"; + fixedRandomDelay = true; + }; +} \ No newline at end of file diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 636ca91..80de576 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -1,4 +1,9 @@ { pkgs, ... }: { + imports = [ + ./autoupdate.nix + ./garbage-collect.nix + ./optimise.nix + ]; system.stateVersion = "23.11"; } \ No newline at end of file diff --git a/hosts/common/garbage-collect.nix b/hosts/common/garbage-collect.nix new file mode 100644 index 0000000..8a029f8 --- /dev/null +++ b/hosts/common/garbage-collect.nix @@ -0,0 +1,9 @@ +{ pkgs, ... }: +{ + nix.gc = { + automatic = true; + dates = "04:30"; + persistent = true; + options = "--delete-older-than 10d"; + }; +} \ No newline at end of file diff --git a/hosts/common/optimise.nix b/hosts/common/optimise.nix new file mode 100644 index 0000000..b4d7458 --- /dev/null +++ b/hosts/common/optimise.nix @@ -0,0 +1,7 @@ +{ pkgs, ... }: +{ + nix.optimise = { + automatic = true; + dates = [ "05:00" ]; + }; +} \ No newline at end of file