diff --git a/machines/moonlark/default.nix b/machines/moonlark/default.nix index cf1f231..e6e4784 100644 --- a/machines/moonlark/default.nix +++ b/machines/moonlark/default.nix @@ -312,6 +312,11 @@ "QargoCoffee-Guest".psk = "Lavazza@7"; "Fulton".psk = "9064405930"; "TP-LINK_ECF0".psk = "ad1066AD!"; + "eduroam" = { + eduroam = true; + identity = "kieranklukas@cedarville.edu"; + pskVar = "psk_cedarville"; + }; }; }; }; diff --git a/modules/nixos/system/wifi.nix b/modules/nixos/system/wifi.nix index f28938e..d120de6 100644 --- a/modules/nixos/system/wifi.nix +++ b/modules/nixos/system/wifi.nix @@ -3,12 +3,18 @@ # This module provides a simpler way to declare wifi profiles with network manager. # - you can pass the PSK via environment variable, direct value, or file. # - profiles are defined in `atelier.network.wifi.profiles`. +# - eduroam networks are supported with the `eduroam = true` flag. # # Example usage: # atelier.network.wifi = { # enable = true; # profiles = { # "MySSID" = { psk = "supersecret"; }; +# "eduroam" = { +# eduroam = true; +# identity = "user@university.edu"; +# psk = "password"; +# }; # }; # }; @@ -26,6 +32,8 @@ let pskVar ? null, psk ? null, pskFile ? null, + eduroam ? false, + identity ? null, }: let base = { @@ -44,7 +52,37 @@ let }; }; sec = - if pskVar != null then + if eduroam then + if pskVar != null then + { + wifi-security = { + key-mgmt = "wpa-eap"; + password = "$" + pskVar; + identity = identity; + phase2-auth = "mschapv2"; + }; + } + else if psk != null then + { + wifi-security = { + key-mgmt = "wpa-eap"; + password = psk; + identity = identity; + phase2-auth = "mschapv2"; + }; + } + else if pskFile != null then + { + wifi-security = { + key-mgmt = "wpa-eap"; + password = "$(" + pkgs.coreutils + "/bin/cat " + pskFile + ")"; + identity = identity; + phase2-auth = "mschapv2"; + }; + } + else + { } + else if pskVar != null then { wifi-security = { key-mgmt = "wpa-psk"; @@ -106,12 +144,22 @@ in type = lib.types.nullOr lib.types.path; default = null; }; + eduroam = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Enable eduroam configuration"; + }; + identity = lib.mkOption { + type = lib.types.nullOr lib.types.str; + default = null; + description = "Identity for eduroam authentication"; + }; }; } ) ); default = { }; - description = "Map of SSID -> { pskVar | psk | pskFile }."; + description = "Map of SSID -> { pskVar | psk | pskFile | eduroam config }."; }; }; diff --git a/secrets/wifi.age b/secrets/wifi.age index b602f01f6fa0cae08b65a296e6418ed43e8e4ff8..9704a3e3d0f676513704a7b87f9a1fa4bc9a8c15 100644 GIT binary patch delta 813 zcmbQic7kn!M!i#3R(`p*NoBfQSxKaKU`|w!aYaUDWMY0{R%Lo(K~R`umAk)dpg~@V zi*|{3Qc{q9WkqIbS%ihLw?UvuN)ea4n@hP%NTp|JW_h-uN07g9grQ@Zd191@nMJvK zWm=A@x1V=*iqF)M^Td}`$nR`iAPHI+^QHfDfNV&JKYj9~)abZSsP?2d$cut|eet=V6 zzOPGYRIou#aiLR0X_Zk`MOI2gQnGUim#L#;u5X&5MX6UsX_0oiVP#HIicg@IL8^I4 zNVZForFoi3QG`dKL0(u&Vq}zKSgvP#BrF*$^QIcs;n16(Slxc8TxxXQo zZ$xIUS8#BSe_}vnj$dk;caoz~xIs#ViNBX)mPuBoVNpO*rAw)!xu3pUX;zVkccy1} zWW8@*g`uB$j$5Fq7Z;bVuC794fk${ns)1*6iGho&VXj3)x|?ZNNG})r?!5nr*~?xxo22OZb)tQ(<5EqxOuC9WiM{03|^+v*VeyQr+Sckxdr)~@^jq!QinXGY!zLDye z_X;}tDDRqSv9;yPJUPprnaq6JLW{n>eX0KC|BET@3r#&&+^Bf;C+G`D*&qM4s=I3E zW#(MlY3s!Cg@Z#TbnDbCyVq@Hw!#~_t9&+bdG{?UUa0NK@x<+gtl*akNBT?E0jwPp ASpWb4