From fe70a624305619714f8d4fb8aa73f43d5db28280 Mon Sep 17 00:00:00 2001 From: willifan Date: Sat, 6 Jul 2024 23:09:27 +0200 Subject: [PATCH 1/3] added autoupdate --- hosts/common/autoupdate.nix | 11 +++++++++++ hosts/common/default.nix | 3 +++ 2 files changed, 14 insertions(+) create mode 100644 hosts/common/autoupdate.nix 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..f8e78d1 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -1,4 +1,7 @@ { pkgs, ... }: { + imports = [ + ./autoupdate.nix + ]; system.stateVersion = "23.11"; } \ No newline at end of file From d4f3f586c60fc2bcfd75f20a0527763b3132617f Mon Sep 17 00:00:00 2001 From: willifan Date: Sat, 6 Jul 2024 23:21:02 +0200 Subject: [PATCH 2/3] added automatic garbage collect --- hosts/common/default.nix | 1 + hosts/common/garbage-collect.nix | 9 +++++++++ 2 files changed, 10 insertions(+) create mode 100644 hosts/common/garbage-collect.nix diff --git a/hosts/common/default.nix b/hosts/common/default.nix index f8e78d1..f8ffc69 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -2,6 +2,7 @@ { imports = [ ./autoupdate.nix + ./garbage-collect.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 From fefa12b88133fab4f2be327f7a438dbe7a64f3e7 Mon Sep 17 00:00:00 2001 From: willifan Date: Sat, 6 Jul 2024 23:24:55 +0200 Subject: [PATCH 3/3] added automatic nix-store optimisation --- hosts/common/default.nix | 1 + hosts/common/optimise.nix | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 hosts/common/optimise.nix diff --git a/hosts/common/default.nix b/hosts/common/default.nix index f8ffc69..80de576 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -3,6 +3,7 @@ imports = [ ./autoupdate.nix ./garbage-collect.nix + ./optimise.nix ]; system.stateVersion = "23.11"; } \ 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