mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-01-21 17:31:34 +01:00
Also rename the wifi module file
This commit is contained in:
parent
42ea9b843e
commit
5c1b5c39d6
1 changed files with 0 additions and 0 deletions
45
modules/system/wifi.nix
Normal file
45
modules/system/wifi.nix
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
networks = [
|
||||
"EW90N.psk"
|
||||
"Fairphone4.psk"
|
||||
"WLAN-233151.psk"
|
||||
"DSL_EXT.psk"
|
||||
"eduroam.8021x"
|
||||
];
|
||||
in
|
||||
{
|
||||
options.custom.wifi.enable = lib.mkEnableOption "";
|
||||
|
||||
config = lib.mkIf config.custom.wifi.enable (
|
||||
lib.mkMerge (
|
||||
lib.flatten [
|
||||
{
|
||||
networking.wireless.iwd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
General.EnableNetworkConfiguration = true;
|
||||
Settings.AutoConnect = true;
|
||||
Network.NameResolvingService = "resolvconf";
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [ pkgs.iwgtk ];
|
||||
}
|
||||
|
||||
(lib.forEach networks (name: {
|
||||
sops.secrets."iwd/${name}" = { };
|
||||
|
||||
systemd.tmpfiles.rules = [
|
||||
"C /var/lib/iwd/${name} - - - - ${config.sops.secrets."iwd/${name}".path}"
|
||||
];
|
||||
}))
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue