1
Fork 0
mirror of https://github.com/RGBCube/ncc synced 2025-07-27 10:07:44 +00:00
ncc/modules/linux/ip.nix
2025-02-23 21:05:40 +03:00

14 lines
452 B
Nix

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