From 3c10ae2f669237e977b3955dda2d06b038d979f2 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 12 Sep 2025 02:37:50 +0200 Subject: [PATCH] nixos/networking: prefer `types.ints` over `addCheck` --- nixos/modules/tasks/network-interfaces.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/tasks/network-interfaces.nix b/nixos/modules/tasks/network-interfaces.nix index 09b6cec4e7ea..4b7e788bc33b 100644 --- a/nixos/modules/tasks/network-interfaces.nix +++ b/nixos/modules/tasks/network-interfaces.nix @@ -82,7 +82,7 @@ let }; prefixLength = mkOption { - type = types.addCheck types.int (n: n >= 0 && n <= (if v == 4 then 32 else 128)); + type = types.ints.between 0 (if v == 4 then 32 else 128); description = '' Subnet mask of the interface, specified as the number of bits in the prefix (`${if v == 4 then "24" else "64"}`). @@ -99,7 +99,7 @@ let }; prefixLength = mkOption { - type = types.addCheck types.int (n: n >= 0 && n <= (if v == 4 then 32 else 128)); + type = types.ints.between 0 (if v == 4 then 32 else 128); description = '' Subnet mask of the network, specified as the number of bits in the prefix (`${if v == 4 then "24" else "64"}`).