From b354e48d48d18ac6c50791c27bd088d4ae0c3e45 Mon Sep 17 00:00:00 2001 From: Minijackson Date: Mon, 10 Apr 2023 15:02:15 +0200 Subject: nix: set NIX_PATH in the same way as the nix registry --- common/default.nix | 5 +---- 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 @@ inputs: -{ config, lib, ... }: +{ config, ... }: { imports = [ @@ -27,8 +27,5 @@ inputs: }) ]; - nix.registry = with lib; - mapAttrs (name: value: { flake = value; }) inputs; - services.nscd.enableNsncd = true; } 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 @@ -inputs: - -{ pkgs, ... }: - -{ +inputs: { + config, + lib, + ... +}: { nix = { gc = { automatic = true; @@ -14,5 +14,13 @@ inputs: auto-optimise-store = true; extra-experimental-features = ["nix-command" "flakes"]; }; + + registry = lib.mapAttrs (_name: value: {flake = value;}) inputs; + nixPath = + lib.mapAttrsToList + (name: value: "${name}=${value.flake}") + (lib.filterAttrs + (name: value: name != "self" && value.flake != null) + config.nix.registry); }; } -- cgit v1.2.3