modules: system: nix: add 'linkInputs' option
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Once again, mirroring the work done in the NixOS module.
This commit is contained in:
parent
ca1e2df1e9
commit
4a6677b024
|
@ -22,6 +22,8 @@ in
|
||||||
options.my.home.nix = with lib; {
|
options.my.home.nix = with lib; {
|
||||||
enable = my.mkDisableOption "nix configuration";
|
enable = my.mkDisableOption "nix configuration";
|
||||||
|
|
||||||
|
linkInputs = my.mkDisableOption "link inputs to `$XDG_CONFIG_HOME/nix/inputs`";
|
||||||
|
|
||||||
addToRegistry = my.mkDisableOption "add inputs and self to registry";
|
addToRegistry = my.mkDisableOption "add inputs and self to registry";
|
||||||
|
|
||||||
overrideNixpkgs = my.mkDisableOption "point nixpkgs to pinned system version";
|
overrideNixpkgs = my.mkDisableOption "point nixpkgs to pinned system version";
|
||||||
|
@ -46,5 +48,17 @@ in
|
||||||
in
|
in
|
||||||
makeEntries channels;
|
makeEntries channels;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
(lib.mkIf cfg.linkInputs {
|
||||||
|
xdg.configFile =
|
||||||
|
let
|
||||||
|
makeLink = n: v: {
|
||||||
|
name = "nix/inputs/${n}";
|
||||||
|
value = { source = v.outPath; };
|
||||||
|
};
|
||||||
|
makeLinks = lib.mapAttrs' makeLink;
|
||||||
|
in
|
||||||
|
makeLinks channels;
|
||||||
|
})
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue