modules: system: nix: add 'linkInputs' option
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:
Bruno BELANYI 2023-02-25 01:41:25 +00:00
parent ca1e2df1e9
commit 4a6677b024

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;
})
]);
}