modules: system: nix: add inputs to NIX_PATH

This commit is contained in:
Bruno BELANYI 2021-12-22 23:47:27 +01:00
parent 0435a50675
commit 5c7ef3232e

View file

@ -1,5 +1,5 @@
# Nix related settings
{ config, inputs, lib, pkgs, ... }:
{ config, inputs, lib, options, pkgs, ... }:
let
cfg = config.my.system.nix;
in
@ -8,6 +8,8 @@ in
enable = my.mkDisableOption "nix configuration";
addToRegistry = my.mkDisableOption "add inputs and self to registry";
addToNixPath = my.mkDisableOption "add inputs and self to nix path";
};
config = lib.mkIf cfg.enable (lib.mkMerge [
@ -31,5 +33,13 @@ in
nur.flake = inputs.nur;
};
})
(lib.mkIf cfg.addToNixPath {
nix.nixPath = options.nix.nixPath.default ++ [
"self=${inputs.self}"
"pkgs=${inputs.nixpkgs}"
"nur=${inputs.nur}"
];
})
]);
}