From 0f0b3df15faba8ba86586c2a0c7693c460e16865 Mon Sep 17 00:00:00 2001 From: Richie Cahill Date: Wed, 10 Apr 2024 19:23:26 -0400 Subject: [PATCH] created nix.nix --- modules/nix.nix | 32 +++++++++++++++++++ systems/configuration.nix | 30 ----------------- users/alice/systems/artemision/non-server.nix | 30 ----------------- users/alice/systems/non-server.nix | 28 ---------------- 4 files changed, 32 insertions(+), 88 deletions(-) create mode 100644 modules/nix.nix diff --git a/modules/nix.nix b/modules/nix.nix new file mode 100644 index 0000000..0dbaa8e --- /dev/null +++ b/modules/nix.nix @@ -0,0 +1,32 @@ +{ lib, ... }: +{ + nix = { + diffSystem = true; + settings = { + experimental-features = [ + "nix-command" + "flakes" + ]; + keep-outputs = true; + builders-use-substitutes = true; + connect-timeout = 20; + }; + + # free up to 10 gb when only 1 gb left + extraOptions = '' + min-free = ${toString (1 * 1024 * 1024 * 1024)} + max-free = ${toString (10 * 1024 * 1024 * 1024)} + ''; + + gc = { + automatic = true; + dates = "weekly"; + options = "--delete-older-than 30d"; + }; + + optimise = { + automatic = true; + dates = [ "01:00" ]; + }; + }; +} diff --git a/systems/configuration.nix b/systems/configuration.nix index 1e7bbcb..878fc6b 100644 --- a/systems/configuration.nix +++ b/systems/configuration.nix @@ -171,36 +171,6 @@ }; }; - nix = { - diffSystem = true; - settings = { - experimental-features = [ - "nix-command" - "flakes" - ]; - keep-outputs = true; - builders-use-substitutes = true; - connect-timeout = 20; - }; - - # free up to 10 gb when only 1 gb left - extraOptions = '' - min-free = ${toString (1 * 1024 * 1024 * 1024)} - max-free = ${toString (10 * 1024 * 1024 * 1024)} - ''; - - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - - optimise = { - automatic = true; - dates = [ "01:00" ]; - }; - }; - system = { autoUpgrade = { enable = true; diff --git a/users/alice/systems/artemision/non-server.nix b/users/alice/systems/artemision/non-server.nix index fd5fb2f..875496d 100644 --- a/users/alice/systems/artemision/non-server.nix +++ b/users/alice/systems/artemision/non-server.nix @@ -60,36 +60,6 @@ # }; # }; - nix = { - diffSystem = true; - settings = { - experimental-features = [ - "nix-command" - "flakes" - ]; - keep-outputs = true; - builders-use-substitutes = true; - connect-timeout = 20; - }; - - # free up to 10 gb when only 1 gb left - extraOptions = '' - min-free = ${toString (1 * 1024 * 1024 * 1024)} - max-free = ${toString (10 * 1024 * 1024 * 1024)} - ''; - - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - - optimise = { - automatic = true; - dates = [ "01:00" ]; - }; - }; - system = { autoUpgrade = { enable = true; diff --git a/users/alice/systems/non-server.nix b/users/alice/systems/non-server.nix index e48f2d1..e10f8e3 100644 --- a/users/alice/systems/non-server.nix +++ b/users/alice/systems/non-server.nix @@ -57,32 +57,4 @@ async = true; }; }; - - nix = { - diffSystem = true; - settings = { - experimental-features = [ - "nix-command" - "flakes" - ]; - keep-outputs = true; - builders-use-substitutes = true; - connect-timeout = 20; - }; - - gc = { - automatic = true; - dates = "weekly"; - options = "--delete-older-than 30d"; - }; - }; - - system = { - autoUpgrade = { - enable = true; - randomizedDelaySec = "1h"; - persistent = true; - flake = "github:RAD-Development/nix-dotfiles"; - }; - }; }