nixos-config/utils/link-input.nix

20 lines
546 B
Nix
Raw Normal View History

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