aboutsummaryrefslogtreecommitdiff
path: root/share/nixos-modules
diff options
context:
space:
mode:
authorMiran Bastaja <miran.bastaja04@gmail.com>2024-07-06 06:48:40 +0200
committerMiran Bastaja <miran.bastaja04@gmail.com>2024-07-06 06:48:40 +0200
commitc97a1d66084aaf50ca816d9c482f296d31346f9f (patch)
treed03726dfb1edfa87b93ca42b9076658c7c50c940 /share/nixos-modules
parentfed01b401d65e655f565fc5c6304f2ab0d758513 (diff)
formatting
Diffstat (limited to 'share/nixos-modules')
-rw-r--r--share/nixos-modules/iwd-ext.nix29
1 files changed, 23 insertions, 6 deletions
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 ''