From d166dc791de86695eb26613b926ccc6a55123448 Mon Sep 17 00:00:00 2001 From: seth Date: Tue, 15 Oct 2024 05:36:19 -0400 Subject: modules/nix: only enable always-allow-substitutes when it exists --- modules/shared/base/nix.nix | 44 ++++++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/modules/shared/base/nix.nix b/modules/shared/base/nix.nix index 075d7be..a46d8cd 100644 --- a/modules/shared/base/nix.nix +++ b/modules/shared/base/nix.nix @@ -24,26 +24,30 @@ in nix = { package = lib.mkIf cfg.lix.enable pkgs.lix; - settings = { - always-allow-substitutes = true; - auto-optimise-store = isLinux; - experimental-features = - [ - "nix-command" - "flakes" - "auto-allocate-uids" - ] - # TODO: remove this nonsense when all implementations remove repl-flake - ++ lib.optional ( - lib.versionOlder config.nix.package.version "2.22.0" # repl-flake was removed in nix 2.22.0 - || lib.versionAtLeast config.nix.package.version "2.90.0" # but not in lix yet - ) "repl-flake"; - - trusted-substituters = [ "https://getchoo.cachix.org" ]; - trusted-public-keys = [ "getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE=" ]; - - nix-path = config.nix.nixPath; - }; + settings = + { + auto-optimise-store = isLinux; + experimental-features = + [ + "nix-command" + "flakes" + "auto-allocate-uids" + ] + # TODO: remove this nonsense when all implementations remove repl-flake + ++ lib.optional ( + lib.versionOlder config.nix.package.version "2.22.0" # repl-flake was removed in nix 2.22.0 + || lib.versionAtLeast config.nix.package.version "2.90.0" # but not in lix yet + ) "repl-flake"; + + trusted-substituters = [ "https://getchoo.cachix.org" ]; + trusted-public-keys = [ "getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE=" ]; + + nix-path = config.nix.nixPath; + } + // lib.mkIf (lib.versionAtLeast config.nix.package.version "2.19.0") { + always-allow-substitutes = true; + + }; gc = { automatic = lib.mkDefault true; -- cgit v1.2.3