From 573723110014e313e161cb9ed25be3f9f9edf6e5 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sat, 8 Jun 2024 22:32:15 -0400 Subject: [PATCH] system: added wifi secrets --- nixosModules/system/default.nix | 2 +- nixosModules/system/wifi.nix | 45 +++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 nixosModules/system/wifi.nix diff --git a/nixosModules/system/default.nix b/nixosModules/system/default.nix index 178e3728..c9552046 100644 --- a/nixosModules/system/default.nix +++ b/nixosModules/system/default.nix @@ -4,7 +4,7 @@ lib, ... }: { - imports = [./plymouth ./power-profiles-daemon ./zramSwap]; + imports = [./plymouth ./power-profiles-daemon ./zramSwap ./wifi.nix]; alyraffauf.system.power-profiles-daemon.enable = lib.mkDefault true; diff --git a/nixosModules/system/wifi.nix b/nixosModules/system/wifi.nix new file mode 100644 index 00000000..36d14ae8 --- /dev/null +++ b/nixosModules/system/wifi.nix @@ -0,0 +1,45 @@ +{ + config, + inputs, + lib, + pkgs, + ... +}: { + imports = [ + inputs.agenix.nixosModules.default + ]; + + age.secrets.Stargate-Discovery.file = ../../secrets/wifi/Stargate-Discovery.age; + age.secrets.wattson.file = ../../secrets/wifi/wattson.age; + + networking.networkmanager = { + ensureProfiles = { + environmentFiles = [ + config.age.secrets.Stargate-Discovery.path + config.age.secrets.wattson.path + ]; + profiles = { + Stargate-Discovery = { + connection.type = "wifi"; + connection.id = "Stargate-Discovery"; + wifi.ssid = "Stargate-Disovery"; + wifi-security = { + auth-alg = "open"; + key-mgmt = "wpa-psk"; + psk = "$StargateDiscoveryPSK"; + }; + }; + wattson = { + connection.type = "wifi"; + connection.id = "wattson"; + wifi.ssid = "wattson"; + wifi-security = { + auth-alg = "open"; + key-mgmt = "wpa-psk"; + psk = "$wattsonPSK"; + }; + }; + }; + }; + }; +}