From b2e5d28f2b2edda1cb95776df3a7136b9ec53c34 Mon Sep 17 00:00:00 2001 From: Dennis Frieberg Date: Sun, 13 Oct 2024 13:45:11 +0200 Subject: [PATCH] nix config to save some space --- nixos/roles/default.nix | 9 +-------- nixos/roles/nix.nix | 27 +++++++++++++++++++++++++++ nixos/roles/nix_keys.nix | 7 ------- 3 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 nixos/roles/nix.nix delete mode 100644 nixos/roles/nix_keys.nix diff --git a/nixos/roles/default.nix b/nixos/roles/default.nix index 2936ac3..851db7c 100644 --- a/nixos/roles/default.nix +++ b/nixos/roles/default.nix @@ -5,18 +5,11 @@ }: { imports = [ ./admins.nix - ./nix_keys.nix + ./nix.nix ./prometheusNodeExporter.nix ../modules/impermanence.nix ]; - nix = { - extraOptions = '' - experimental-features = nix-command flakes - builders-use-substitutes = true - ''; - }; - networking = { firewall = { # these shoud be default, but better make sure! diff --git a/nixos/roles/nix.nix b/nixos/roles/nix.nix new file mode 100644 index 0000000..bd5c6e1 --- /dev/null +++ b/nixos/roles/nix.nix @@ -0,0 +1,27 @@ +{ + nix = { + settings = { + trusted-public-keys = [ + "nerflap2-1:pDZCg0oo9PxNQxwVSQSvycw7WXTl53PGvVeZWvxuqJc=" + "gonne.mathebau.de-1:FsXFyFiBFE/JxC9MCkt/WuiXjx5dkRI9RXj0FxOQrV0=" + ]; + experimental-features = [ + "flakes" + "nix-command" + ]; + auto-optimise-store = true; + fallback = true; + builders-use-substitutes = true; + }; + gc = { + persistent = true; + dates = "weekly"; + options = "-d"; + randomizedDelaySec = "5h"; + }; + optimise = { + dates = []; + automatic = true; + }; + }; +} diff --git a/nixos/roles/nix_keys.nix b/nixos/roles/nix_keys.nix deleted file mode 100644 index 97e5dc5..0000000 --- a/nixos/roles/nix_keys.nix +++ /dev/null @@ -1,7 +0,0 @@ -{ - imports = []; - nix.settings.trusted-public-keys = [ - "nerflap2-1:pDZCg0oo9PxNQxwVSQSvycw7WXTl53PGvVeZWvxuqJc=" - "gonne.mathebau.de-1:FsXFyFiBFE/JxC9MCkt/WuiXjx5dkRI9RXj0FxOQrV0=" - ]; -}