diff --git a/host/bachtel.nix b/host/bachtel.nix index e8a6cf9..156c846 100644 --- a/host/bachtel.nix +++ b/host/bachtel.nix @@ -2,36 +2,17 @@ # your system. Help is available in the configuration.nix(5) man page # and in the NixOS manual (accessible by running ‘nixos-help’). -{ config, pkgs, ... }: - -let - routerConfig = { - wanInterface = "wwp0s19u1u3i12"; - wireless = { - wleInterface = "wlp5s0"; - wleSSID = "hauser"; - wlePassphrase = "mifatielma"; - }; - lanInterfaces = [ "enp1s0" "enp2s0" "enp3s0" "enp4s0" ]; - lanNetwork = { - routerAddress = "10.2.1.1"; - netid = "10.2.1.0"; - revIpDomain = "1.2.10"; - prefixLength = 24; - domain = "rappi.fh2.ch"; - dhcpRange = "10.2.1.2,10.2.1.249"; - routerHostName = "bachtel"; - }; - }; - -in { +{ config, pkgs, ... }: { imports = [ ../hardware/apu.nix ../hardware/wle900vx.nix ../role/base ../role/wwan - (import ../role/router routerConfig) + ../role/router + ../role/router-dhcp + ../role/router-dns + ../role/router-wireless-ap ]; fileSystems."/" = { @@ -46,7 +27,31 @@ in { services.wwan = { enable = true; apn = "gprs.swisscom.ch"; - networkInterface = routerConfig.wanInterface; + networkInterface = "wwp0s19u1u3i12"; + }; + + services.router = { + enable = true; + wanInterface = "wwp0s19u1u3i12"; + wirelessInterfaces = [ "wlp5s0" ]; + lanInterfaces = [ "enp1s0" "enp2s0" "enp3s0" "enp4s0" ]; + internalRouterIP = "10.2.1.1"; + dhcp = { + enable = true; + localDomain = "rappi.fh2.ch"; + dhcpRange = "10.2.1.2,10.2.1.249"; + }; + recursiveDns = { + enable = true; + networkIdIp = "10.2.1.0"; + }; + wireless = { + enable = true; + #wleInterface24Ghz = "wlp4s0"; + wleInterface5Ghz = "wlp5s0"; + ssid = "hauser"; + passphrase = "mifatielma"; + }; }; # Use the GRUB 2 boot loader. @@ -58,8 +63,7 @@ in { # Define on which hard drive you want to install Grub. boot.loader.grub.device = "/dev/sda"; # or "nodev" for efi only - networking.hostName = - routerConfig.lanNetwork.routerHostName; # Define your hostname. + networking.hostName = "bachtel"; # Define your hostname. #networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. #networking.wireless.networks = { # yummi = {