diff options
| author | seth <[email protected]> | 2023-08-23 22:19:22 -0400 |
|---|---|---|
| committer | seth <[email protected]> | 2023-08-24 04:21:43 -0400 |
| commit | af6a211d9a763b87b62062ae60826ef88967b3e8 (patch) | |
| tree | 38d15773d2d9cba2dcf8c30bb19bf2ac247c28df /modules | |
| parent | f324d84bc86db1b4b81c447f536adc24f7731578 (diff) | |
hosts/profiles+modules: centralize nix/nixpkgs options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/nixos/base/default.nix | 1 | ||||
| -rw-r--r-- | modules/nixos/server/default.nix | 13 | ||||
| -rw-r--r-- | modules/shared/base/nix.nix | 23 |
3 files changed, 25 insertions, 12 deletions
diff --git a/modules/nixos/base/default.nix b/modules/nixos/base/default.nix index 3e6a97e..ed0fb23 100644 --- a/modules/nixos/base/default.nix +++ b/modules/nixos/base/default.nix @@ -13,6 +13,7 @@ in { ./documentation.nix ./locale.nix ./network.nix + ./nix.nix ./packages.nix ./root.nix ./security.nix diff --git a/modules/nixos/server/default.nix b/modules/nixos/server/default.nix index dd8e40b..f1ef1db 100644 --- a/modules/nixos/server/default.nix +++ b/modules/nixos/server/default.nix @@ -29,18 +29,7 @@ in { options = "-d --delete-older-than 2d"; }; - settings = { - allowed-users = [config.networking.hostName]; - trusted-substituters = [ - "https://getchoo.cachix.org" - "https://nix-community.cachix.org" - ]; - - trusted-public-keys = [ - "getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE=" - "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" - ]; - }; + settings.allowed-users = [config.networking.hostName]; }; nixpkgs.overlays = [(_: prev: {unstable = import nixpkgs {inherit (prev) system;};})]; diff --git a/modules/shared/base/nix.nix b/modules/shared/base/nix.nix index 21af0e0..d1b7e60 100644 --- a/modules/shared/base/nix.nix +++ b/modules/shared/base/nix.nix @@ -1,5 +1,6 @@ { config, + inputs, lib, pkgs, ... @@ -12,9 +13,26 @@ in { config = mkIf cfg.enable { nix = { + registry = + { + n.flake = mkDefault inputs.nixpkgs; + } + // (builtins.mapAttrs (_: flake: {inherit flake;}) + (inputs.nixpkgs.lib.filterAttrs (n: _: n != "nixpkgs") inputs)); + settings = { auto-optimise-store = isLinux; experimental-features = ["nix-command" "flakes" "auto-allocate-uids" "repl-flake"]; + + trusted-substituters = [ + "https://getchoo.cachix.org" + "https://nix-community.cachix.org" + ]; + + trusted-public-keys = [ + "getchoo.cachix.org-1:ftdbAUJVNaFonM0obRGgR5+nUmdLMM+AOvDOSx0z5tE=" + "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=" + ]; }; gc = { @@ -22,5 +40,10 @@ in { options = mkDefault "--delete-older-than 7d"; }; }; + + nixpkgs = { + overlays = with inputs; [nur.overlay getchoo.overlays.default self.overlays.default]; + config.allowUnfree = true; + }; }; } |
