Reformat all Nix files
This commit is contained in:
parent
9e0c1102a9
commit
355b63cf73
81 changed files with 2293 additions and 1153 deletions
|
@ -1,17 +1,23 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
let
|
||||
importScript = pkgs.writers.writePython3 "install-wifi-import"
|
||||
{
|
||||
libraries = [ pkgs.python3Packages.pyaml ];
|
||||
}
|
||||
(builtins.readFile ./import.py);
|
||||
importScript = pkgs.writers.writePython3 "install-wifi-import" {
|
||||
libraries = [ pkgs.python3Packages.pyaml ];
|
||||
} (builtins.readFile ./import.py);
|
||||
applyScript = pkgs.writers.writePython3 "install-wifi-apply" { } (builtins.readFile ./apply.py);
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [
|
||||
(pkgs.writeShellApplication {
|
||||
name = "install-wifi";
|
||||
runtimeInputs = with pkgs; [ wpa_supplicant diffutils ];
|
||||
runtimeInputs = with pkgs; [
|
||||
wpa_supplicant
|
||||
diffutils
|
||||
];
|
||||
text = ''
|
||||
temp="$(mktemp --directory --suffix="-install-wifi")"
|
||||
cd "$temp"
|
||||
|
@ -61,8 +67,7 @@ in
|
|||
"WiFi in de trein"
|
||||
"_WIFI_LYRIA"
|
||||
"WIFIonICE"
|
||||
]
|
||||
(ssid: { });
|
||||
] (ssid: { });
|
||||
userControlled.enable = true; # Allow some control with wpa_cli
|
||||
};
|
||||
services.chrony.serverOption = "offline";
|
||||
|
@ -71,8 +76,8 @@ in
|
|||
wantedBy = [ "wpa_supplicant.service" ];
|
||||
path = with pkgs; [ wpa_supplicant ];
|
||||
script = ''
|
||||
for i in {1..50}; do wpa_cli status &> /dev/null && break; sleep 0.1; done
|
||||
${applyScript}
|
||||
for i in {1..50}; do wpa_cli status &> /dev/null && break; sleep 0.1; done
|
||||
${applyScript}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue