From c97a1d66084aaf50ca816d9c482f296d31346f9f Mon Sep 17 00:00:00 2001 From: Miran Bastaja Date: Sat, 6 Jul 2024 06:48:40 +0200 Subject: formatting --- share/nixos-modules/iwd-ext.nix | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'share/nixos-modules/iwd-ext.nix') diff --git a/share/nixos-modules/iwd-ext.nix b/share/nixos-modules/iwd-ext.nix index 09327a9..754be40 100644 --- a/share/nixos-modules/iwd-ext.nix +++ b/share/nixos-modules/iwd-ext.nix @@ -1,6 +1,17 @@ -{ config, lib, pkgs, ... }: +{ + config, + lib, + pkgs, + ... +}: let - inherit (lib) mkEnableOption mkIf mkOption types recursiveUpdate; + inherit (lib) + mkEnableOption + mkIf + mkOption + types + recursiveUpdate + ; cfg = config.networking.wireless.iwd-ext; ini = pkgs.formats.ini { }; @@ -8,12 +19,14 @@ let # without UseDefaultInterface, sometimes wlan0 simply goes AWOL with # NetworkManager # https://iwd.wiki.kernel.org/interface_lifecycle#interface_management_in_iwd - General.UseDefaultInterface = with config.networking.networkmanager; + General.UseDefaultInterface = + with config.networking.networkmanager; (enable && (wifi.backend == "iwd")); }; configFile = ini.generate "main.conf" (recursiveUpdate defaults cfg.settings); -in { +in +{ options.networking.wireless.iwd-ext = { enable = mkEnableOption (lib.mdDoc "iwd"); @@ -50,8 +63,12 @@ in { type = types.attrsOf ini.type; default = { }; example = { - HomeNetwork = { Security.PreSharedKey = "totallysecurepsk"; }; - "@NETWORK_2_SSID@" = { Security.PreSharedKey = "@NETWORK_2_PSK@"; }; + HomeNetwork = { + Security.PreSharedKey = "totallysecurepsk"; + }; + "@NETWORK_2_SSID@" = { + Security.PreSharedKey = "@NETWORK_2_PSK@"; + }; }; description = lib.mdDoc '' -- cgit v1.3.1