feat(meta/isp): vlan flags
All checks were successful
Check workflows / check_workflows (pull_request) Successful in 16s
Check meta / check_dns (pull_request) Successful in 21s
Check meta / check_meta (pull_request) Successful in 21s
Build all the nodes / netcore01 (pull_request) Successful in 19s
Build all the nodes / netaccess01 (pull_request) Successful in 20s
Build all the nodes / netcore02 (pull_request) Successful in 20s
Run pre-commit on all files / pre-commit (push) Successful in 25s
Build all the nodes / ap01 (pull_request) Successful in 31s
Build the shell / build-shell (pull_request) Successful in 27s
Run pre-commit on all files / pre-commit (pull_request) Successful in 23s
Build all the nodes / hypervisor01 (pull_request) Successful in 1m42s
Build all the nodes / bridge01 (pull_request) Successful in 1m44s
Build all the nodes / geo01 (pull_request) Successful in 1m48s
Build all the nodes / build01 (pull_request) Successful in 1m49s
Build all the nodes / hypervisor03 (pull_request) Successful in 1m47s
Build all the nodes / rescue01 (pull_request) Successful in 1m34s
Build all the nodes / geo02 (pull_request) Successful in 1m54s
Build all the nodes / hypervisor02 (pull_request) Successful in 1m57s
Build all the nodes / web03 (pull_request) Successful in 1m40s
Build all the nodes / tower01 (pull_request) Successful in 1m52s
Build all the nodes / vault01 (pull_request) Successful in 1m57s
Build all the nodes / web02 (pull_request) Successful in 1m57s
Build all the nodes / compute01 (pull_request) Successful in 2m20s
Build all the nodes / storage01 (pull_request) Successful in 2m4s
Build all the nodes / web01 (pull_request) Successful in 2m25s

This commit is contained in:
catvayor 2025-03-02 18:49:09 +01:00
parent 92890e2228
commit bfedf05cc4
Signed by: lbailly
GPG key ID: CE3E645251AC63F3
2 changed files with 261 additions and 224 deletions

View file

@ -35,7 +35,6 @@ let
in
{
config = {
systemd = {
network = {
config.routeTables."user" = 1000;
@ -269,5 +268,4 @@ in
users.users."systemd-network".extraGroups = [ "keys" ];
boot.kernel.sysctl."net.ipv4.ip_forward" = true;
};
}

View file

@ -2,13 +2,17 @@
#
# SPDX-License-Identifier: EUPL-1.2
{ lib, ... }:
{ lib, config, ... }:
let
inherit (lib)
attrValues
genAttrs
mkDefault
mkIf
mkMerge
mkOption
optional
;
inherit (lib.types)
@ -16,10 +20,13 @@ let
attrsOf
bool
ints
listOf
nullOr
submodule
str
;
cfg = config.isp;
in
{
@ -30,6 +37,15 @@ in
{ config, ... }:
{
options = {
flags = mkOption {
type = listOf str;
default = optional config.userOnly "users";
defaultText = ''optional config.userOnly "users"'';
description = ''
Groups of VLANs this VLAN belong to.
'';
};
id = mkOption {
type = ints.between 0 (4096 - 1);
description = ''
@ -97,10 +113,33 @@ in
}
)
);
default = [ ];
default = { };
description = ''
The list of VLANs known to our ISP.
'';
};
vlans-groups = mkOption {
type = attrsOf (submodule {
options.id-list = mkOption {
type = listOf (ints.between 0 (4096 - 1));
description = ''
List of VLANs IDs inside this group.
'';
};
});
default = { };
description = ''
The list of groups of VLANs known to our ISP.
'';
};
};
config.isp.vlans-groups = mkMerge (
map (
{ flags, id, ... }:
genAttrs flags (_: {
id-list = [ id ];
})
) (attrValues cfg.vlans)
);
}