modules: system: nix: add 'linkInputs' option
continuous-integration/drone/push Build is passing Details

Once again, mirroring the work done in the NixOS module.
This commit is contained in:
Bruno BELANYI 2023-02-25 01:41:25 +00:00
parent ca1e2df1e9
commit 4a6677b024
1 changed files with 14 additions and 0 deletions

View File

@ -22,6 +22,8 @@ in
options.my.home.nix = with lib; {
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";
overrideNixpkgs = my.mkDisableOption "point nixpkgs to pinned system version";
@ -46,5 +48,17 @@ in
in
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;
})
]);
}