All checks were successful
Run pre-commit on all files / pre-commit (push) Successful in 22s
27 lines
723 B
Nix
27 lines
723 B
Nix
# SPDX-FileCopyrightText: 2024 Ryan Lahfa <ryan.lahfa@dgnum.eu>
|
|
#
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
|
|
{ config, nodeMeta, ... }:
|
|
let
|
|
svc = config.system.service;
|
|
inherit (nodeMeta.extraNodeSettings) ap-no;
|
|
adminIp = "192.168.1.${builtins.toString (ap-no + 10)}";
|
|
in
|
|
{
|
|
# Our bridging is a bit complicated, therefore, we need iproute2.
|
|
programs.iproute2.enable = true;
|
|
|
|
services.admin-ip = svc.network.address.build {
|
|
interface = config.hardware.networkInterfaces.lan;
|
|
address = adminIp;
|
|
prefixLength = 24;
|
|
family = "inet";
|
|
};
|
|
|
|
services.admin-defaultroute4 = svc.network.route.build {
|
|
via = "192.168.1.254";
|
|
target = "default";
|
|
dependencies = [ config.services.admin-ip ];
|
|
};
|
|
}
|