modular interface involation
This commit is contained in:
+11
-4
@@ -24,7 +24,6 @@
|
|||||||
./hwaccel.nix
|
./hwaccel.nix
|
||||||
|
|
||||||
# Services
|
# Services
|
||||||
./keepalived.nix
|
|
||||||
./wireguard.nix
|
./wireguard.nix
|
||||||
./docker.nix
|
./docker.nix
|
||||||
./docker-device-mapper.nix
|
./docker-device-mapper.nix
|
||||||
@@ -47,13 +46,21 @@
|
|||||||
networking.hostName = config.vars.hostname; # Define your hostname.
|
networking.hostName = config.vars.hostname; # Define your hostname.
|
||||||
networking.hostId = config.vars.hostid; # Define your hostID - Needs to be unique!.
|
networking.hostId = config.vars.hostid; # Define your hostID - Needs to be unique!.
|
||||||
networking = {
|
networking = {
|
||||||
interfaces.${lib.head config.vars.interfaces} = {
|
interfaces = let
|
||||||
ipv4.addresses = [{
|
primaryInterface = lib.head config.vars.interfaces;
|
||||||
|
secondaryInterfaces = lib.tail config.vars.interfaces;
|
||||||
|
in
|
||||||
|
lib.foldr (name: acc: acc // {
|
||||||
|
${name}.useDHCP = true;
|
||||||
|
}) (
|
||||||
|
{ ${primaryInterface}.ipv4.addresses = [{
|
||||||
address = config.vars.local_ip;
|
address = config.vars.local_ip;
|
||||||
prefixLength = 24;
|
prefixLength = 24;
|
||||||
}];
|
}];
|
||||||
|
}
|
||||||
|
) secondaryInterfaces;
|
||||||
};
|
};
|
||||||
};
|
|
||||||
networking.defaultGateway = {
|
networking.defaultGateway = {
|
||||||
address = "192.168.178.1";
|
address = "192.168.178.1";
|
||||||
interface = lib.head config.vars.interfaces;
|
interface = lib.head config.vars.interfaces;
|
||||||
|
|||||||
Reference in New Issue
Block a user