diff --git a/configs/pepe/configuration.nix b/configs/pepe/configuration.nix index 5e9621b..ceb8cec 100644 --- a/configs/pepe/configuration.nix +++ b/configs/pepe/configuration.nix @@ -10,6 +10,7 @@ ./syncthing.nix ./tinc.nix ./wifi-access-point.nix + ./lan.nix ./dms.nix ]; diff --git a/configs/pepe/lan.nix b/configs/pepe/lan.nix new file mode 100644 index 0000000..c7877fd --- /dev/null +++ b/configs/pepe/lan.nix @@ -0,0 +1,26 @@ +{ lib, pkgs, ... }: +let + + interface = "enp0s25"; + ipAddress = "10.1.0.2"; + prefixLength = 24; + +in { + + networking.extraHosts = '' + 10.1.0.1 workout.lan + 10.1.0.2 pepe.lan + ''; + + # todo only open needed ports + networking.firewall.trustedInterfaces = [ interface ]; + + networking.networkmanager.unmanaged = [ interface ]; + networking.dhcpcd.denyInterfaces = [ interface ]; + + networking.interfaces."${interface}".ipv4.addresses = [{ + address = ipAddress; + prefixLength = prefixLength; + }]; + +} diff --git a/configs/workout/configuration.nix b/configs/workout/configuration.nix index 6524f92..385b570 100644 --- a/configs/workout/configuration.nix +++ b/configs/workout/configuration.nix @@ -9,7 +9,7 @@ #./slack.nix ./syncthing.nix ./tinc.nix - + ./lan.nix ]; networking.hostName = "workout"; diff --git a/configs/workout/lan.nix b/configs/workout/lan.nix new file mode 100644 index 0000000..04dcf3e --- /dev/null +++ b/configs/workout/lan.nix @@ -0,0 +1,26 @@ +{ lib, pkgs, ... }: +let + + interface = "eno1"; + ipAddress = "10.1.0.1"; + prefixLength = 24; + +in { + + networking.extraHosts = '' + 10.1.0.1 workout.lan + 10.1.0.2 pepe.lan + ''; + + # todo only open needed ports + networking.firewall.trustedInterfaces = [ interface ]; + + networking.networkmanager.unmanaged = [ interface ]; + networking.dhcpcd.denyInterfaces = [ interface ]; + + networking.interfaces."${interface}".ipv4.addresses = [{ + address = ipAddress; + prefixLength = prefixLength; + }]; + +}