infrastructure/machines/liminix/ap-dev/addresses.nix

28 lines
723 B
Nix
Raw Normal View History

2025-02-06 10:32:24 +01:00
# 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 ];
};
}