1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2026-01-15 01:31:02 +00:00
ncc/modules/linux/ip.nix
2025-02-23 21:05:40 +03:00

16 lines
454 B
Nix

{ config, lib, ... }: let
inherit (config.networking.defaultGateway) interface;
inherit (lib) optionals;
in {
networking.interfaces.${interface} = {
ipv4.addresses = optionals (config.networking.ipv4 != null) [{
address = config.networking.ipv4;
prefixLength = 22;
}];
ipv6.addresses = optionals (config.networking.ipv4 != null) [{
address = config.networking.ipv6;
prefixLength = 64;
}];
};
}