From ff2f7ef61cfe0a2d1919a002bd1285c2874b37f5 Mon Sep 17 00:00:00 2001 From: Silas Schöffel Date: Mon, 8 Apr 2024 15:47:31 +0200 Subject: refactor: move networking to modules --- modules/nixos/sils/default.nix | 1 + modules/nixos/sils/networking.nix | 38 ++++++++++++++++++++++++++++++++++++++ sys/default.nix | 1 - sys/networking/default.nix | 38 -------------------------------------- 4 files changed, 39 insertions(+), 39 deletions(-) create mode 100644 modules/nixos/sils/networking.nix delete mode 100644 sys/networking/default.nix diff --git a/modules/nixos/sils/default.nix b/modules/nixos/sils/default.nix index dfa0510..2d15138 100644 --- a/modules/nixos/sils/default.nix +++ b/modules/nixos/sils/default.nix @@ -2,6 +2,7 @@ imports = [ ./basesystem.nix ./meta.nix + ./networking.nix ./nix.nix ./plymouth.nix ./theming.nix diff --git a/modules/nixos/sils/networking.nix b/modules/nixos/sils/networking.nix new file mode 100644 index 0000000..efbbbf8 --- /dev/null +++ b/modules/nixos/sils/networking.nix @@ -0,0 +1,38 @@ +{ + config, + self, + ... +}: { + networking = { + useDHCP = true; + #nameservers = ["2620:fe::fe" "2620:fe::9" "9.9.9.9" "149.112.112.112"]; + wireless = { + enable = true; + environmentFile = config.age.secrets.wireless.path; + networks = { + # Important: Never forget the second '@'! + "@SSID_N0@".psk = "@PSK_N0@"; + "@SSID_N1@".psk = "@PSK_N1@"; + "@SSID_N2@".psk = "@PSK_N2@"; + "@SSID_N3@".psk = "@PSK_N3@"; + "@SSID_N4@" = { + auth = '' + proto=RSN + key_mgmt=WPA-EAP + pairwise=CCMP + auth_alg=OPEN + eap=PEAP + identity="@IDENTITY_N4@" + password="@PSK_N4@" + ca_cert="${self}/files/DNSX-CA.pem" + ''; + }; + "@SSID_N5@".psk = "@PSK_N5@"; + }; + userControlled = { + enable = true; + group = "wheel"; # TODO: Change this? + }; + }; + }; +} diff --git a/sys/default.nix b/sys/default.nix index 155bf1e..82d323a 100644 --- a/sys/default.nix +++ b/sys/default.nix @@ -7,7 +7,6 @@ ./font ./impermanence ./keyboard - ./networking ./opengl ./packages ./services diff --git a/sys/networking/default.nix b/sys/networking/default.nix deleted file mode 100644 index efbbbf8..0000000 --- a/sys/networking/default.nix +++ /dev/null @@ -1,38 +0,0 @@ -{ - config, - self, - ... -}: { - networking = { - useDHCP = true; - #nameservers = ["2620:fe::fe" "2620:fe::9" "9.9.9.9" "149.112.112.112"]; - wireless = { - enable = true; - environmentFile = config.age.secrets.wireless.path; - networks = { - # Important: Never forget the second '@'! - "@SSID_N0@".psk = "@PSK_N0@"; - "@SSID_N1@".psk = "@PSK_N1@"; - "@SSID_N2@".psk = "@PSK_N2@"; - "@SSID_N3@".psk = "@PSK_N3@"; - "@SSID_N4@" = { - auth = '' - proto=RSN - key_mgmt=WPA-EAP - pairwise=CCMP - auth_alg=OPEN - eap=PEAP - identity="@IDENTITY_N4@" - password="@PSK_N4@" - ca_cert="${self}/files/DNSX-CA.pem" - ''; - }; - "@SSID_N5@".psk = "@PSK_N5@"; - }; - userControlled = { - enable = true; - group = "wheel"; # TODO: Change this? - }; - }; - }; -} -- cgit 1.4.1