forked from zentralwerk/network
Add config.site.net-combined
This commit is contained in:
parent
0e1ccff6ab
commit
a510e60e4d
|
@ -1,4 +1,8 @@
|
|||
{ lib, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
let
|
||||
concatMapAttrsRecursive = with lib; f: flip pipe [ (mapAttrs f) attrValues (foldl' recursiveUpdate { }) ];
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
# Secrets
|
||||
|
@ -9,7 +13,9 @@
|
|||
./switch.nix
|
||||
./ap.nix
|
||||
./server.nix
|
||||
] ++
|
||||
]
|
||||
# IP networks
|
||||
lib.filesystem.listFilesRecursive ./net;
|
||||
++ lib.filesystem.listFilesRecursive ./net;
|
||||
|
||||
site.net-combined = concatMapAttrsRecursive (name: value: { inherit (value) hosts4 hosts6; }) config.site.net;
|
||||
}
|
||||
|
|
22
flake.lock
22
flake.lock
|
@ -2,16 +2,16 @@
|
|||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1670700605,
|
||||
"narHash": "sha256-5dlpATkcyITpdtMflhltuD+A3RNpsVI1Mb+dtKkll6Y=",
|
||||
"lastModified": 1671501966,
|
||||
"narHash": "sha256-lU7VRKyqWrkE71BmJXlPGOJX7IFiia1CS15HhVwr8L4=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "7b9eeb856cbf976482fa8d1cb295ea03fb3e1277",
|
||||
"rev": "333601f9a610632388e5613810f180babfbb7f53",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "release-22.05",
|
||||
"ref": "release-22.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
|
@ -19,11 +19,11 @@
|
|||
"openwrt": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1670801318,
|
||||
"narHash": "sha256-qhXRQ6pgDON7i1qvd6KjXgDlj8mY2cY9eG+pTJtZq/c=",
|
||||
"lastModified": 1671487822,
|
||||
"narHash": "sha256-92mcPLi2nICLpOseqdH9dDti81hkD47rJrQK48aMQl8=",
|
||||
"ref": "openwrt-22.03",
|
||||
"rev": "aef33ab13a294ba879d3d2f9407015feeb4e3908",
|
||||
"revCount": 54439,
|
||||
"rev": "3de4572ed30865450047c0b2641afae20bcced15",
|
||||
"revCount": 54459,
|
||||
"type": "git",
|
||||
"url": "https://git.openwrt.org/openwrt/openwrt.git"
|
||||
},
|
||||
|
@ -40,11 +40,11 @@
|
|||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1671205751,
|
||||
"narHash": "sha256-lpoeHn5HNkUOxhBpvK6aF/A0I9zQzTRAYxA0MAaSt+Y=",
|
||||
"lastModified": 1671442525,
|
||||
"narHash": "sha256-iC/SZW6kKEl/ystG/6dU7WBZmoCarpxHS/clp3Ep15g=",
|
||||
"owner": "astro",
|
||||
"repo": "nix-openwrt-imagebuilder",
|
||||
"rev": "61d5a2a164b833837d0ac386afae3753806718d3",
|
||||
"rev": "cfc545f1776d7886559abb5f362281dfb147883f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
description = "Zentralwerk network";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/release-22.05";
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/release-22.11";
|
||||
openwrt = {
|
||||
url = "git+https://git.openwrt.org/openwrt/openwrt.git?ref=openwrt-22.03";
|
||||
flake = false;
|
||||
|
|
|
@ -587,6 +587,12 @@ in
|
|||
type = with types; attrsOf (submodule netOpts);
|
||||
};
|
||||
|
||||
net-combined = mkOption {
|
||||
description = "All hosts of all subnets";
|
||||
default = {};
|
||||
type = with types; submodule netOpts;
|
||||
};
|
||||
|
||||
hosts = mkOption {
|
||||
description = "All the static hosts";
|
||||
default = {};
|
||||
|
|
Loading…
Reference in New Issue