2021-09-17 11:12:23 +02:00
|
|
|
{ pkgs, ... }:
|
|
|
|
|
let
|
|
|
|
|
autowifi = pkgs.writers.writePython3Bin "autowifi" { flakeIgnore = [ "E501" ]; } <stockholm/lass/5pkgs/autowifi/autowifi.py>;
|
|
|
|
|
in
|
|
|
|
|
{
|
|
|
|
|
networking.networkmanager = {
|
|
|
|
|
enable = true;
|
|
|
|
|
wifi.macAddress = "random";
|
|
|
|
|
ethernet.macAddress = "random";
|
|
|
|
|
unmanaged = [ "docker*" ];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
users.users.me.extraGroups = [ "networkmanager" ];
|
|
|
|
|
|
|
|
|
|
systemd.services.autowifi = {
|
2021-09-17 20:49:39 +02:00
|
|
|
enable = false;
|
2021-09-17 11:12:23 +02:00
|
|
|
description = "Automatic wifi connector";
|
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
path = [ pkgs.networkmanager ];
|
|
|
|
|
serviceConfig = {
|
|
|
|
|
Type = "simple";
|
|
|
|
|
Restart = "always";
|
|
|
|
|
RestartSec = "10s";
|
|
|
|
|
ExecStart = "${autowifi}/bin/autowifi";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
networking.networkmanager.dispatcherScripts = [
|
2021-09-17 20:49:39 +02:00
|
|
|
{ source = "${pkgs.nur.repos.makefu.prison-break}/bin/prison-break"; }
|
2021-09-17 11:12:23 +02:00
|
|
|
];
|
|
|
|
|
}
|