introduce back static ipv4 prefix lenght but with default value

This commit is contained in:
Alex 2023-04-05 14:04:11 +02:00
parent bb25797d2f
commit 16422d2809
4 changed files with 9 additions and 4 deletions

View file

@ -10,7 +10,7 @@
boot.loader.timeout = 20; boot.loader.timeout = 20;
deuxfleurs.hostName = "df-pw5"; deuxfleurs.hostName = "df-pw5";
deuxfleurs.staticIPv4.address = "192.168.5.130/24"; deuxfleurs.staticIPv4.address = "192.168.5.130";
deuxfleurs.staticIPv6.address = "2a02:a03f:6510:5102:223:24ff:feb0:e8a7"; deuxfleurs.staticIPv6.address = "2a02:a03f:6510:5102:223:24ff:feb0:e8a7";
system.stateVersion = "22.11"; system.stateVersion = "22.11";

View file

@ -9,7 +9,7 @@
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
deuxfleurs.hostName = "origan"; deuxfleurs.hostName = "origan";
deuxfleurs.staticIPv4.address = "192.168.1.33/24"; deuxfleurs.staticIPv4.address = "192.168.1.33";
deuxfleurs.staticIPv6.address = "2a01:e0a:5e4:1d0:223:24ff:feaf:fdec"; deuxfleurs.staticIPv6.address = "2a01:e0a:5e4:1d0:223:24ff:feaf:fdec";
deuxfleurs.isRaftServer = true; deuxfleurs.isRaftServer = true;

View file

@ -9,7 +9,7 @@
boot.loader.efi.canTouchEfiVariables = true; boot.loader.efi.canTouchEfiVariables = true;
deuxfleurs.hostName = "piranha"; deuxfleurs.hostName = "piranha";
deuxfleurs.staticIPv4.address = "192.168.1.25/24"; deuxfleurs.staticIPv4.address = "192.168.1.25";
deuxfleurs.staticIPv6.address = "2a01:cb05:9142:7400:223:24ff:feb0:ea82"; deuxfleurs.staticIPv6.address = "2a01:cb05:9142:7400:223:24ff:feb0:ea82";
deuxfleurs.isRaftServer = true; deuxfleurs.isRaftServer = true;

View file

@ -37,6 +37,11 @@ in
type = nullOr str; type = nullOr str;
default = null; default = null;
}; };
staticIPv4.prefixLength = mkOption {
description = "IPv4 prefix length for LAN addresses, only used with static configuration";
type = int;
default = 24;
};
staticIPv6.defaultGateway = mkOption { staticIPv6.defaultGateway = mkOption {
description = '' description = ''
IPv6 address of the default route on the local network interface. IPv6 address of the default route on the local network interface.
@ -161,7 +166,7 @@ in
matchConfig.Name = "en* eth*"; matchConfig.Name = "en* eth*";
address = address =
optional noDHCP "${cfg.staticIPv4.address}" optional noDHCP "${cfg.staticIPv4.address}/${toString cfg.staticIPv4.prefixLength}"
++ optional noRA "${cfg.staticIPv6.address}/${toString cfg.staticIPv6.prefixLength}"; ++ optional noRA "${cfg.staticIPv6.address}/${toString cfg.staticIPv6.prefixLength}";
routes = routes =