Kieran's opinionated (and probably slightly dumb) nix config

feat: add eduroam support

dunkirk.sh fa28055c a2ff4a53

verified
Changed files
+55 -2
machines
moonlark
modules
nixos
system
secrets
+5
machines/moonlark/default.nix
···
"QargoCoffee-Guest".psk = "Lavazza@7";
"Fulton".psk = "9064405930";
"TP-LINK_ECF0".psk = "ad1066AD!";
+
"eduroam" = {
+
eduroam = true;
+
identity = "kieranklukas@cedarville.edu";
+
pskVar = "psk_cedarville";
+
};
};
};
};
+50 -2
modules/nixos/system/wifi.nix
···
# 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";
+
# };
# };
# };
···
pskVar ? null,
psk ? null,
pskFile ? null,
+
eduroam ? false,
+
identity ? null,
}:
let
base = {
···
};
};
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";
···
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 }.";
};
};
secrets/wifi.age

This is a binary file and will not be displayed.