From 4a6677b024fdc91a97c990d705f9f2e1fa046500 Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Sat, 25 Feb 2023 01:41:25 +0000 Subject: [PATCH] modules: system: nix: add 'linkInputs' option Once again, mirroring the work done in the NixOS module. --- home/nix/default.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/home/nix/default.nix b/home/nix/default.nix index b05a1d0..c46e990 100644 --- a/home/nix/default.nix +++ b/home/nix/default.nix @@ -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; + }) ]); }