nixos-config/utils/link-input.nix

17 lines
508 B
Nix
Raw Normal View History

2022-04-13 18:27:52 +00:00
inputs: { lib, ... }:
let
# Taken from https://github.com/gytis-ivaskevicius/flake-utils-plus/blob/master/lib/options.nix
inherit (lib) filterAttrs mapAttrs';
flakes = filterAttrs (name: value: value ? outputs) inputs;
nixRegistry = builtins.mapAttrs
(name: v: { flake = v; })
flakes;
in
{
nix.registry = nixRegistry;
environment.etc = mapAttrs'
(name: value: { name = "nix/inputs/${name}"; value = { source = value.outPath; }; })
inputs;
nix.nixPath = [ "/etc/nix/inputs" ];
}