diff --git a/nixos/modules/nixos/system/nix.nix b/nixos/modules/nixos/system/nix.nix index f75c7e1..51a9002 100644 --- a/nixos/modules/nixos/system/nix.nix +++ b/nixos/modules/nixos/system/nix.nix @@ -25,45 +25,12 @@ in type = lib.types.bool; description = "Persistent timer for gc, runs at startup if timer missed"; default = true; - }; }; }; nix = { - settings = { - # Enable flakes - experimental-features = [ - "nix-command" - "flakes" - ]; - - # Substitutions - trusted-substituters = [ - "https://nix-community.cachix.org" - "https://numtide.cachix.org" - ]; - - trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE=" - ]; - - # Fallback quickly if substituters are not available. - connect-timeout = 5; - # Avoid copying unnecessary stuff over SSH - builders-use-substitutes = true; - - - trusted-users = [ "root" "@wheel" ]; - - warn-dirty = false; - - # The default at 10 is rarely enough. - log-lines = lib.mkDefault 25; - - }; optimise.automatic = cfg.autoOptimiseStore; diff --git a/nixos/profiles/global.nix b/nixos/profiles/global.nix index be82a63..5d0c2f6 100644 --- a/nixos/profiles/global.nix +++ b/nixos/profiles/global.nix @@ -9,10 +9,10 @@ with lib; # Not sure at this point a good way to manage globals in one place # without mono-repo config. - # Generated by nixos-config-generate + imports = [ - (modulesPath + "/installer/scan/not-detected.nix") + (modulesPath + "/installer/scan/not-detected.nix") # Generated by nixos-config-generate ./global/nix.nix ]; diff --git a/nixos/profiles/global/nix.nix b/nixos/profiles/global/nix.nix index 618eaf5..11a2614 100644 --- a/nixos/profiles/global/nix.nix +++ b/nixos/profiles/global/nix.nix @@ -1,84 +1,41 @@ -{ lib, ... }: +{ lib, config, ... }: { - nix = { - nix = { - settings = { - # Enable flakes - experimental-features = [ - "nix-command" - "flakes" - ]; - - # Substitutions - trusted-substituters = [ - "https://nix-community.cachix.org" - "https://numtide.cachix.org" - ]; - - trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE=" - ]; - - # Fallback quickly if substituters are not available. - connect-timeout = 5; - # Avoid copying unnecessary stuff over SSH - builders-use-substitutes = true; - trusted-users = [ "root" "@wheel" ]; + nix.settings = { + # Enable flakes + experimental-features = [ + "nix-command" + "flakes" + ]; - warn-dirty = false; + # Substitutions + trusted-substituters = [ + "https://nix-community.cachix.org" + "https://numtide.cachix.org" + ]; - # The default at 10 is rarely enough. - log-lines = lib.mkDefault 25; + trusted-public-keys = [ + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE=" + ]; - }; - - }; - - settings = { - # Enable flakes - experimental-features = [ - "nix-command" - "flakes" - ]; - - # Substitutions - trusted-substituters = [ - "https://nix-community.cachix.org" - "https://numtide.cachix.org" - ]; - - trusted-public-keys = [ - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - "numtide.cachix.org-1:2ps1kLBUWjxIneOy1Ik6cQjb41X0iXVXeHigGmycPPE=" - ]; - - # Fallback quickly if substituters are not available. - connect-timeout = 5; - # Avoid copying unnecessary stuff over SSH - builders-use-substitutes = true; + # Fallback quickly if substituters are not available. + connect-timeout = 5; + # Avoid copying unnecessary stuff over SSH + builders-use-substitutes = true; - trusted-users = [ "root" "@wheel" ]; + trusted-users = [ "root" "@wheel" ]; - warn-dirty = false; + warn-dirty = false; - # The default at 10 is rarely enough. - log-lines = lib.mkDefault 25; - - }; - - optimise.automatic = cfg.autoOptimiseStore; - - # automatically garbage collect nix store - gc = mkIf cfg.gc.enabled { - # garbage collection - automatic = cfg.gc.enabled; - options = "--delete-older-than 30d"; - persistent = cfg.gc.persistent; - }; + # The default at 10 is rarely enough. + log-lines = lib.mkDefault 25; }; + + + + }