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';
|
|
|
|
flakes = filterAttrs (name: value: 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
|
|
|
}
|