tree-wide: format with nixfmt

Another saturday another useless formatter change.
It's my dotfiles, after all

alejandra doesn't handle c-style inline comments well.
This commit is contained in:
Primrose 2025-11-08 10:15:58 +08:00
parent ec704b5272
commit ebf8468807
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
116 changed files with 1895 additions and 1689 deletions

View file

@ -2,7 +2,8 @@ let
preferredPriority = 20;
privatePriority = 10;
limitedPriority = -10;
in [
in
[
{
ssid = "~";
priority = preferredPriority;
@ -36,7 +37,7 @@ in [
priority = privatePriority;
scanOnLowSignal = true;
authProtocols = ["WPA-EAP"];
authProtocols = [ "WPA-EAP" ];
auth = ''
pairwise=CCMP
group=CCMP TKIP
@ -81,13 +82,13 @@ in [
randomizeMac = true;
}
{ssid = "_SNCF_WIFI_INOUI";}
{ssid = "_WIFI_LYRIA";}
{ssid = "EurostarTrainsWiFi";}
{ssid = "SBB-FREE";}
{ssid = "AOT Airport Free Wi-Fi by NT";}
{ssid = "NewTaipei";}
{ssid = "Fami-WiFi";}
{ ssid = "_SNCF_WIFI_INOUI"; }
{ ssid = "_WIFI_LYRIA"; }
{ ssid = "EurostarTrainsWiFi"; }
{ ssid = "SBB-FREE"; }
{ ssid = "AOT Airport Free Wi-Fi by NT"; }
{ ssid = "NewTaipei"; }
{ ssid = "Fami-WiFi"; }
{
ssid = "iPhone de Léana ";

View file

@ -6,32 +6,39 @@ let
lib = import (sources.nixpkgs + "/lib");
# wpa_supplicant uses `strchr` to seek to the first `=`, so the only forbidden character is `=`.
escapePwdKey = lib.replaceStrings ["="] ["_"];
escapePwdKey = lib.replaceStrings [ "=" ] [ "_" ];
go = networkArgs @ {
ssid,
# Custom fields wrapping nixpkgs module options
hasPassword ? false,
scanOnLowSignal ? false,
randomizeMac ? false,
...
}: {
${ssid} = lib.mkMerge [
(builtins.removeAttrs networkArgs ["ssid" "hasPassword" "scanOnLowSignal" "randomizeMac"])
(lib.optionalAttrs hasPassword {
pskRaw = "ext:${escapePwdKey ssid}";
})
(lib.optionalAttrs scanOnLowSignal {
extraConfig = ''
bgscan="simple:30:-70:3600"
'';
})
(lib.optionalAttrs randomizeMac {
extraConfig = ''
mac_addr=1
'';
})
];
};
go =
networkArgs@{
ssid,
# Custom fields wrapping nixpkgs module options
hasPassword ? false,
scanOnLowSignal ? false,
randomizeMac ? false,
...
}:
{
${ssid} = lib.mkMerge [
(builtins.removeAttrs networkArgs [
"ssid"
"hasPassword"
"scanOnLowSignal"
"randomizeMac"
])
(lib.optionalAttrs hasPassword {
pskRaw = "ext:${escapePwdKey ssid}";
})
(lib.optionalAttrs scanOnLowSignal {
extraConfig = ''
bgscan="simple:30:-70:3600"
'';
})
(lib.optionalAttrs randomizeMac {
extraConfig = ''
mac_addr=1
'';
})
];
};
in
ns: lib.mkMerge (map go ns)
ns: lib.mkMerge (map go ns)