diff --git a/desktop/mods/pxeboot.nix b/desktop/mods/pxeboot.nix index ad99282..c0de16e 100644 --- a/desktop/mods/pxeboot.nix +++ b/desktop/mods/pxeboot.nix @@ -1,13 +1,19 @@ { config, pkgs, ... }: { networking = { firewall = { - allowedTCPPorts = [ 2049 ]; + allowedTCPPorts = [ + 2049 + 53 + ]; allowedUDPPorts = [ + 53 547 + 67 69 ]; }; nat = { + enable = true; enableIPv6 = true; internalInterfaces = [ "br0" ]; }; diff --git a/mods/host.nix b/mods/host.nix index a5ed3fc..10d65e0 100644 --- a/mods/host.nix +++ b/mods/host.nix @@ -16,33 +16,19 @@ ./vps-init.nix ]; networking = { - firewall = { - allowedTCPPorts = [ 53 ]; - allowedUDPPorts = [ - 53 - 67 - ]; - }; - nat.enable = true; networkmanager.ensureProfiles = { environmentFiles = [ config.sops.secrets.wifi-env.path ]; - profiles = { - dhcp-ethernet.connection = { - id = "dhcp-ethernet"; - type = "ethernet"; + profiles.home-wifi = { + connection = { + id = "home-wifi"; + type = "wifi"; }; - home-wifi = { - connection = { - id = "home-wifi"; - type = "wifi"; - }; - ipv6.method = "disabled"; - wifi-security = { - key-mgmt = "sae"; - psk = "$BOGALE_5_PSK"; - }; - wifi.ssid = "bogale_5"; + ipv6.method = "disabled"; + wifi-security = { + key-mgmt = "sae"; + psk = "$BOGALE_5_PSK"; }; + wifi.ssid = "bogale_5"; }; }; wg-quick.interfaces.awg0.type = "amneziawg"; diff --git a/server/configuration.nix b/server/configuration.nix index 6aa2723..575b715 100644 --- a/server/configuration.nix +++ b/server/configuration.nix @@ -1,8 +1,5 @@ -{ config, pkgs, ... }: { - boot.kernelParams = [ - "cfg80211.ieee80211_regdom=RU" - "consoleblank=60" - ]; +{ config, ... }: { + boot.kernelParams = [ "consoleblank=60" ]; imports = [ ../mods/host.nix ./hardware.nix @@ -22,26 +19,9 @@ allowedUDPPorts = [ 443 ]; }; hostName = "nixos-server"; - nat.internalInterfaces = [ "wlp2s0" ]; - networkmanager.ensureProfiles.profiles = { - dhcp-ethernet.ethernet.cloned-mac-address = "0C:0E:76:A6:E6:B6"; - home-wifi = { - ipv4 = { - addresses = "10.1.0.1/16"; - method = "shared"; - }; - wifi = { - band = "a"; - channel = 157; - channel-width = 80; - mode = "ap"; - }; - wifi-security = { - group = "ccmp"; - pairwise = "ccmp"; - proto = "rsn"; - }; - }; + networkmanager.ensureProfiles.profiles.dhcp-ethernet.connection = { + id = "dhcp-ethernet"; + type = "ethernet"; }; wg-quick.interfaces.awg0.configFile = config.sops.templates.awg1-conf.path; }; diff --git a/server/mods/ap.nix b/server/mods/ap.nix new file mode 100644 index 0000000..c4ee327 --- /dev/null +++ b/server/mods/ap.nix @@ -0,0 +1,32 @@ +{ + boot.kernelParams = [ "cfg80211.ieee80211_regdom=RU" ]; + networking = { + firewall = { + allowedTCPPorts = [ 53 ]; + allowedUDPPorts = [ + 53 + 67 + ]; + }; + networkmanager.ensureProfiles.profiles = { + dhcp-ethernet.ethernet.cloned-mac-address = "0C:0E:76:A6:E6:B6"; + home-wifi = { + ipv4 = { + addresses = "10.1.0.1/16"; + method = "shared"; + }; + wifi = { + band = "a"; + channel = 157; + channel-width = 80; + mode = "ap"; + }; + wifi-security = { + group = "ccmp"; + pairwise = "ccmp"; + proto = "rsn"; + }; + }; + }; + }; +}