diff --git a/configuration.nix b/configuration.nix index 900825b..c50f6c1 100644 --- a/configuration.nix +++ b/configuration.nix @@ -32,9 +32,6 @@ # Cleanup tmp on startup boot.cleanTmpDir = true; - # Set hostname - networking.hostName = "zion"; - # Create coolneng user users.users.coolneng = { isNormalUser = true; @@ -54,7 +51,6 @@ services.timesyncd.enable = true; # Enable ZFS support - networking.hostId = "4e74ea68"; boot.supportedFilesystems = [ "zfs" ]; # Scrub zpool monthly diff --git a/modules/networking.nix b/modules/networking.nix index f4b512a..facf7e1 100644 --- a/modules/networking.nix +++ b/modules/networking.nix @@ -3,6 +3,25 @@ let password = builtins.readFile /var/keys/ddclient; in { + # Assign a static IP + networking = { + hostName = "zion"; + hostId = "33dc5014"; + interfaces.eth0 = { + useDHCP = false; + ipv4.addresses = [{ + address = "192.168.13.2"; + prefixLength = 24; + }]; + }; + defaultGateway = { + address = "192.168.13.1"; + interface = "eth0"; + }; + nameservers = [ "195.10.195.195" "165.22.224.164" ]; + enableIPv6 = false; + }; + # Enable zeroconf services.avahi = { enable = true; @@ -42,12 +61,6 @@ in { ''; }; - # Disable IPv6 - networking.enableIPv6 = false; - - # Disable WiFi - networking.interfaces."eth0".useDHCP = true; - # Enable NAT for wireguard networking.nat = { enable = true; @@ -79,7 +92,7 @@ in { # DNS server with ad-block services.dnsmasq = { enable = true; - servers = [ "195.10.195.195" "165.22.224.164" ]; + servers = config.networking.nameservers; extraConfig = '' domain-needed bogus-priv