diff options
author | Minijackson <minijackson@riseup.net> | 2023-04-10 15:02:15 +0200 |
---|---|---|
committer | Minijackson <minijackson@riseup.net> | 2023-04-10 15:02:15 +0200 |
commit | b354e48d48d18ac6c50791c27bd088d4ae0c3e45 (patch) | |
tree | 8dd26bed483fa11f85322e4e883d24908f81b55d /common | |
parent | 520ac2b328b227625685082464ccab0e2564726e (diff) | |
download | nixos-config-reborn-b354e48d48d18ac6c50791c27bd088d4ae0c3e45.tar.gz nixos-config-reborn-b354e48d48d18ac6c50791c27bd088d4ae0c3e45.zip |
nix: set NIX_PATH in the same way as the nix registry
Diffstat (limited to 'common')
-rw-r--r-- | common/default.nix | 5 | ||||
-rw-r--r-- | common/nix.nix | 18 |
2 files changed, 14 insertions, 9 deletions
diff --git a/common/default.nix b/common/default.nix index 7b53735..60385d3 100644 --- a/common/default.nix +++ b/common/default.nix | |||
@@ -1,6 +1,6 @@ | |||
1 | inputs: | 1 | inputs: |
2 | 2 | ||
3 | { config, lib, ... }: | 3 | { config, ... }: |
4 | 4 | ||
5 | { | 5 | { |
6 | imports = [ | 6 | imports = [ |
@@ -27,8 +27,5 @@ inputs: | |||
27 | }) | 27 | }) |
28 | ]; | 28 | ]; |
29 | 29 | ||
30 | nix.registry = with lib; | ||
31 | mapAttrs (name: value: { flake = value; }) inputs; | ||
32 | |||
33 | services.nscd.enableNsncd = true; | 30 | services.nscd.enableNsncd = true; |
34 | } | 31 | } |
diff --git a/common/nix.nix b/common/nix.nix index e31bcbf..0e58908 100644 --- a/common/nix.nix +++ b/common/nix.nix | |||
@@ -1,8 +1,8 @@ | |||
1 | inputs: | 1 | inputs: { |
2 | 2 | config, | |
3 | { pkgs, ... }: | 3 | lib, |
4 | 4 | ... | |
5 | { | 5 | }: { |
6 | nix = { | 6 | nix = { |
7 | gc = { | 7 | gc = { |
8 | automatic = true; | 8 | automatic = true; |
@@ -14,5 +14,13 @@ inputs: | |||
14 | auto-optimise-store = true; | 14 | auto-optimise-store = true; |
15 | extra-experimental-features = ["nix-command" "flakes"]; | 15 | extra-experimental-features = ["nix-command" "flakes"]; |
16 | }; | 16 | }; |
17 | |||
18 | registry = lib.mapAttrs (_name: value: {flake = value;}) inputs; | ||
19 | nixPath = | ||
20 | lib.mapAttrsToList | ||
21 | (name: value: "${name}=${value.flake}") | ||
22 | (lib.filterAttrs | ||
23 | (name: value: name != "self" && value.flake != null) | ||
24 | config.nix.registry); | ||
17 | }; | 25 | }; |
18 | } | 26 | } |