forked from c3d2/nix-config
flake.nix: pull in the zentralwerk network db
This commit is contained in:
parent
b83aeccaa1
commit
42a32a42dc
29
flake.nix
29
flake.nix
|
@ -4,6 +4,7 @@
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/release-21.05";
|
nixpkgs.url = "github:nixos/nixpkgs/release-21.05";
|
||||||
secrets.url = "git+ssh://git@gitea.c3d2.de:2222/c3d2-admins/secrets.git";
|
secrets.url = "git+ssh://git@gitea.c3d2.de:2222/c3d2-admins/secrets.git";
|
||||||
|
zentralwerk.url = "git+https://gitea.c3d2.de/zentralwerk/network.git";
|
||||||
yammat.url = "git+https://gitea.c3d2.de/astro/yammat.git?ref=nix";
|
yammat.url = "git+https://gitea.c3d2.de/astro/yammat.git?ref=nix";
|
||||||
yammat.inputs.nixpkgs.follows = "nixpkgs";
|
yammat.inputs.nixpkgs.follows = "nixpkgs";
|
||||||
scrapers.url = "git+https://gitea.c3d2.de/astro/scrapers.git";
|
scrapers.url = "git+https://gitea.c3d2.de/astro/scrapers.git";
|
||||||
|
@ -12,11 +13,35 @@
|
||||||
tigger.flake = false;
|
tigger.flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nixpkgs, secrets, nixos-hardware, yammat, scrapers, tigger }:
|
outputs = { self, nixpkgs, secrets, nixos-hardware, zentralwerk, yammat, scrapers, tigger }:
|
||||||
let
|
let
|
||||||
forAllSystems = nixpkgs.lib.genAttrs [ "aarch64-linux" "x86_64-linux" ];
|
forAllSystems = nixpkgs.lib.genAttrs [ "aarch64-linux" "x86_64-linux" ];
|
||||||
|
|
||||||
hostRegistry = import ./host-registry.nix;
|
inherit (nixpkgs.lib) recursiveUpdate;
|
||||||
|
extractZwHosts = { hosts4, hosts6, ... }:
|
||||||
|
recursiveUpdate (
|
||||||
|
builtins.foldl' (result: name:
|
||||||
|
recursiveUpdate result {
|
||||||
|
"${name}".ip4 = hosts4.${name};
|
||||||
|
}
|
||||||
|
) {} (builtins.attrNames hosts4)
|
||||||
|
) (
|
||||||
|
builtins.foldl' (result: ctx:
|
||||||
|
builtins.foldl' (result: name:
|
||||||
|
recursiveUpdate result {
|
||||||
|
"${name}".ip6 = hosts6.${ctx}.${name};
|
||||||
|
}
|
||||||
|
) result (builtins.attrNames hosts6.${ctx})
|
||||||
|
) {} (builtins.attrNames hosts6)
|
||||||
|
);
|
||||||
|
zwHostRegistry = {
|
||||||
|
hosts =
|
||||||
|
builtins.foldl' (result: net:
|
||||||
|
recursiveUpdate result (extractZwHosts zentralwerk.lib.config.site.net.${net})
|
||||||
|
) {} [ "core" "c3d2" "serv" ];
|
||||||
|
};
|
||||||
|
extraHostRegistry = import ./host-registry.nix;
|
||||||
|
hostRegistry = nixpkgs.lib.recursiveUpdate zwHostRegistry extraHostRegistry;
|
||||||
in {
|
in {
|
||||||
|
|
||||||
overlay = import ./overlay;
|
overlay = import ./overlay;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user