From 13b70df944a317da52b72308f459e00333a27d87 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Sat, 19 Aug 2023 02:40:48 +0800 Subject: [PATCH] feat: use wireless interface for nozomi & yukina --- hosts/rolling_girls/nozomi/default.nix | 28 +++++++++++++++++++++++--- hosts/rolling_girls/yukina/default.nix | 28 +++++++++++++++++++++++--- 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/hosts/rolling_girls/nozomi/default.nix b/hosts/rolling_girls/nozomi/default.nix index 9ef541b1..e1cdd075 100644 --- a/hosts/rolling_girls/nozomi/default.nix +++ b/hosts/rolling_girls/nozomi/default.nix @@ -32,7 +32,19 @@ # Set static IP address / gateway / DNS servers. networking = { hostName = "nozomi"; # Define your hostname. - wireless.enable = false; + wireless = { + # https://wiki.archlinux.org/title/wpa_supplicant + enable = true; + # The path to the file containing the WPA passphrase. + # secrets are not supported well on riscv64, I nned to create this file manually. + # Format: "PSK_WEMEET_PRIVATE_WIFI=your_password" + environmentFile = "/etc/wpa_supplicant.env"; + # The network definitions to automatically connect to when wpa_supplicant is running. + networks = { + # read WPAPSK from environmentFile + "shadow_light_ryan".psk = "@PSK_WEMEET_PRIVATE_WIFI@"; + }; + }; # Failed to enable firewall due to the following error: # firewall-start[2300]: iptables: Failed to initialize nft: Protocol not supported @@ -48,8 +60,8 @@ # proxy.default = "http://user:password@proxy:port/"; # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # LPI4A's first ethernet interface - interfaces.end0 = { + # LPI4A's wireless interface + interfaces.wlan0 = { useDHCP = false; ipv4.addresses = [ { @@ -58,6 +70,16 @@ } ]; }; + # LPI4A's first ethernet interface + # interfaces.end0 = { + # useDHCP = false; + # ipv4.addresses = [ + # { + # address = "192.168.5.104"; + # prefixLength = 24; + # } + # ]; + # }; # LPI4A's second ethernet interface # interfaces.end1 = { # useDHCP = false; diff --git a/hosts/rolling_girls/yukina/default.nix b/hosts/rolling_girls/yukina/default.nix index d225090d..0a1b80bf 100644 --- a/hosts/rolling_girls/yukina/default.nix +++ b/hosts/rolling_girls/yukina/default.nix @@ -32,7 +32,19 @@ # Set static IP address / gateway / DNS servers. networking = { hostName = "yukina"; # Define your hostname. - wireless.enable = false; + wireless = { + # https://wiki.archlinux.org/title/wpa_supplicant + enable = true; + # The path to the file containing the WPA passphrase. + # secrets are not supported well on riscv64, I nned to create this file manually. + # Format: "PSK_WEMEET_PRIVATE_WIFI=your_password" + environmentFile = "/etc/wpa_supplicant.env"; + # The network definitions to automatically connect to when wpa_supplicant is running. + networks = { + # read WPAPSK from environmentFile + "shadow_light_ryan".psk = "@PSK_WEMEET_PRIVATE_WIFI@"; + }; + }; # Failed to enable firewall due to the following error: # firewall-start[2300]: iptables: Failed to initialize nft: Protocol not supported @@ -48,8 +60,8 @@ # proxy.default = "http://user:password@proxy:port/"; # proxy.noProxy = "127.0.0.1,localhost,internal.domain"; - # LPI4A's first ethernet interface - interfaces.end0 = { + # LPI4A's wireless interface + interfaces.wlan0 = { useDHCP = false; ipv4.addresses = [ { @@ -58,6 +70,16 @@ } ]; }; + # LPI4A's first ethernet interface + # interfaces.end0 = { + # useDHCP = false; + # ipv4.addresses = [ + # { + # address = "192.168.5.105"; + # prefixLength = 24; + # } + # ]; + # }; # LPI4A's second ethernet interface # interfaces.end1 = { # useDHCP = false;