Configuration for my NixOS based systems and Home Manager
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

NETWORKING initial config

+33 -16
+33 -16
networking.nix
··· 4 4 # Pick only one of the below networking options. 5 5 # networking.wireless.enable = true; # Enables wireless support via wpa_supplicant. 6 6 # networking.networkmanager.enable = true; # Easiest to use and most distros use this by default. 7 - networking.hostName = "odin"; 7 + networking.hostName = "othinus"; 8 8 # I like systemd-networkd 9 9 systemd.network.enable = true; 10 10 systemd.network.networks."50-wlp2s0" = { ··· 12 12 networkConfig.DHCP = "yes"; 13 13 linkConfig.RequiredForOnline = "no"; 14 14 }; 15 + 16 + networking.interfaces = { 17 + enp4s0f1 = { 18 + ipv4.addresses = [{ 19 + address = "192.168.1.4"; 20 + prefixLength = 24; 21 + }]; 22 + }; 23 + }; 24 + networking.defaultGateway = { 25 + address = "192.168.1.1"; 26 + interface = "enp4s0f1"; 27 + }; 28 + 29 + networking.nameservers = [ 30 + "192.168.1.3" 31 + "192.168.1.5" 32 + "45.90.28.93" 33 + "45.90.30.93" 34 + ]; 35 + 36 + # This is necessary for ZFX 37 + networking.hostId = "0d14fe47"; 38 + 15 39 networking.useNetworkd = true; 16 40 # TODO: static IP @ 192.168.1.2 17 41 ··· 23 47 # networking.firewall.allowedUDPPorts = [ ... ]; 24 48 # Or disable the firewall altogether. 25 49 # TODO: allow some ports 26 - networking.firewall.enable = true; 50 + networking.firewall = { 51 + enable = true; 52 + allowPing = true; 53 + allowedTCPPorts = [ 54 + # iperf3 55 + 5201 56 + ]; 57 + }; 27 58 28 59 services.avahi = { 29 60 enable = true; ··· 36 67 }; 37 68 }; 38 69 39 - # NFS mounts 40 - 41 - fileSystems = { 42 - "/srv/shokuhou" = { 43 - device = "192.168.1.3:/srv/shokuhou"; 44 - fsType = "nfs"; 45 - options = ["nfsvers=4" "user" "x-system.automount" "x-system.idle-timeout=600"]; 46 - }; 47 - "/srv/mentalout" = { 48 - device = "192.168.1.3:/srv/mentalout"; 49 - fsType = "nfs"; 50 - options = ["nfsvers=4" "user" "x-system.automount" "x-system.idle-timeout=600"]; 51 - }; 52 - }; 53 70 }