mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 20:39:18 -08:00
26 lines
799 B
Nix
26 lines
799 B
Nix
{ config, lib, ... }: with lib; {
|
|
options = {
|
|
networks = mkOption {
|
|
type = with types; attrsOf (submodule ({ name, config, ... }: {
|
|
options = {
|
|
member_configs = mkOption {
|
|
type = unspecified;
|
|
};
|
|
members = mkOption {
|
|
type = unspecified;
|
|
};
|
|
};
|
|
}));
|
|
};
|
|
};
|
|
config = {
|
|
networks = let
|
|
names = [ "gensokyo" "chitei" "internet" "tailscale" ];
|
|
network_filter = network: rec {
|
|
member_configs = filterAttrs (_: nodeConfig: nodeConfig.networks.${network}.interfaces != []) config.network.nodes.nixos;
|
|
members = mapAttrs (_: nodeConfig: nodeConfig.networks.${network}) member_configs;
|
|
};
|
|
networks' = genAttrs names network_filter;
|
|
in networks';
|
|
};
|
|
}
|