modules: system: nix: add inputs to NIX_PATH
This commit is contained in:
parent
0435a50675
commit
5c7ef3232e
|
@ -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}"
|
||||
];
|
||||
})
|
||||
]);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue