nix-conf/nixos-modules/events/37c3/default.nix

59 lines
1.4 KiB
Nix
Raw Permalink Normal View History

2023-12-30 23:39:33 +01:00
{ config, lib, ... }:
2024-07-10 23:02:54 +02:00
let
cfg = config.events."37c3";
in
{
2023-12-30 23:39:33 +01:00
options.events."37c3" = {
enable = lib.mkEnableOption "Enable settings for the 37c3 event";
};
config = lib.mkIf cfg.enable {
networking.networkmanager.ensureProfiles.profiles = {
"37C3" = {
connection = {
id = "37C3";
type = "wifi";
interface-name = "wlan0";
};
wifi = {
mode = "infrastructure";
ssid = "37C3";
};
wifi-security = {
auth-alg = "open";
key-mgmt = "wpa-eap";
};
"802-1x" = {
anonymous-identity = "37C3";
eap = "ttls;";
identity = "37C3";
password = "37C3";
phase2-auth = "mschapv2";
};
2024-07-10 23:02:54 +02:00
ipv4 = {
method = "auto";
};
2023-12-30 23:39:33 +01:00
ipv6 = {
addr-gen-mode = "default";
method = "auto";
};
};
networking.wireless.networks."37C3".auth = ''
key_mgmt=WPA-EAP
eap=TTLS
identity="37C3"
password="37C3"
ca_cert="${
builtins.fetchurl {
url = "https://letsencrypt.org/certs/isrgrootx1.pem";
2024-07-10 23:02:54 +02:00
sha256 = "sha256:1la36n2f31j9s03v847ig6ny9lr875q3g7smnq33dcsmf2i5gd92";
2023-12-30 23:39:33 +01:00
}
}"
altsubject_match="DNS:radius.c3noc.net"
phase2="auth=PAP"
'';
};
};
}