modules: system: nix: add '/etc/nix/inputs' links
This commit is contained in:
parent
607d11bbad
commit
c1214547da
|
@ -7,6 +7,8 @@ in
|
|||
options.my.system.nix = with lib; {
|
||||
enable = my.mkDisableOption "nix configuration";
|
||||
|
||||
linkInputs = my.mkDisableOption "link inputs to `/etc/nix/inputs/`";
|
||||
|
||||
addToRegistry = my.mkDisableOption "add inputs and self to registry";
|
||||
|
||||
addToNixPath = my.mkDisableOption "add inputs and self to nix path";
|
||||
|
@ -38,6 +40,24 @@ in
|
|||
};
|
||||
})
|
||||
|
||||
(lib.mkIf cfg.linkInputs {
|
||||
environment.etc =
|
||||
let
|
||||
makeLink = n: v: {
|
||||
name = "nix/inputs/${n}";
|
||||
value = { source = v.outPath; };
|
||||
};
|
||||
makeLinks = lib.mapAttrs' makeLink;
|
||||
in
|
||||
makeLinks {
|
||||
inherit (inputs)
|
||||
self
|
||||
nixpkgs
|
||||
nur
|
||||
;
|
||||
};
|
||||
})
|
||||
|
||||
(lib.mkIf cfg.addToNixPath {
|
||||
nix.nixPath = [
|
||||
"self=${inputs.self}"
|
||||
|
|
Loading…
Reference in a new issue