From 819524a0d334e511ef38b8f09cfa1a56b9c51b61 Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Sun, 11 Sep 2016 18:14:34 +0900 Subject: [PATCH] supplicant module: optionSet -> submodule --- .../services/networking/supplicant.nix | 203 +++++++++--------- 1 file changed, 101 insertions(+), 102 deletions(-) diff --git a/nixos/modules/services/networking/supplicant.nix b/nixos/modules/services/networking/supplicant.nix index 16c4ee7e33bb..2bcffe6bd48d 100644 --- a/nixos/modules/services/networking/supplicant.nix +++ b/nixos/modules/services/networking/supplicant.nix @@ -75,7 +75,107 @@ in options = { networking.supplicant = mkOption { - type = types.attrsOf types.optionSet; + type = with types; attrsOf (submodule { + options = { + + configFile = { + + path = mkOption { + type = types.path; + example = literalExample "/etc/wpa_supplicant.conf"; + description = '' + External wpa_supplicant.conf configuration file. + The configuration options defined declaratively within networking.supplicant have + precedence over options defined in configFile. + ''; + }; + + writable = mkOption { + type = types.bool; + default = false; + description = '' + Whether the configuration file at configFile.path should be written to by + wpa_supplicant. + ''; + }; + + }; + + extraConf = mkOption { + type = types.lines; + default = ""; + example = '' + ap_scan=1 + device_name=My-NixOS-Device + device_type=1-0050F204-1 + driver_param=use_p2p_group_interface=1 + disable_scan_offload=1 + p2p_listen_reg_class=81 + p2p_listen_channel=1 + p2p_oper_reg_class=81 + p2p_oper_channel=1 + manufacturer=NixOS + model_name=NixOS_Unstable + model_number=2015 + ''; + description = '' + Configuration options for wpa_supplicant.conf. + Options defined here have precedence over options in configFile. + NOTE: Do not write sensitive data into extraConf as it will + be world-readable in the nix-store. For sensitive information + use the configFile instead. + ''; + }; + + extraCmdArgs = mkOption { + type = types.str; + default = ""; + example = "-e/var/run/wpa_supplicant/entropy.bin"; + description = + "Command line arguments to add when executing wpa_supplicant."; + }; + + driver = mkOption { + type = types.nullOr types.str; + default = "nl80211,wext"; + description = "Force a specific wpa_supplicant driver."; + }; + + bridge = mkOption { + type = types.str; + default = ""; + description = "Name of the bridge interface that wpa_supplicant should listen at."; + }; + + userControlled = { + + enable = mkOption { + type = types.bool; + default = false; + description = '' + Allow normal users to control wpa_supplicant through wpa_gui or wpa_cli. + This is useful for laptop users that switch networks a lot and don't want + to depend on a large package such as NetworkManager just to pick nearby + access points. + ''; + }; + + socketDir = mkOption { + type = types.str; + default = "/var/run/wpa_supplicant"; + description = "Directory of sockets for controlling wpa_supplicant."; + }; + + group = mkOption { + type = types.str; + default = "wheel"; + example = "network"; + description = "Members of this group can control wpa_supplicant."; + }; + + }; + }; + }); default = { }; @@ -109,107 +209,6 @@ in service that can be accessed through D-Bus. ''; - options = { - - configFile = { - - path = mkOption { - type = types.path; - example = literalExample "/etc/wpa_supplicant.conf"; - description = '' - External wpa_supplicant.conf configuration file. - The configuration options defined declaratively within networking.supplicant have - precedence over options defined in configFile. - ''; - }; - - writable = mkOption { - type = types.bool; - default = false; - description = '' - Whether the configuration file at configFile.path should be written to by - wpa_supplicant. - ''; - }; - - }; - - extraConf = mkOption { - type = types.lines; - default = ""; - example = '' - ap_scan=1 - device_name=My-NixOS-Device - device_type=1-0050F204-1 - driver_param=use_p2p_group_interface=1 - disable_scan_offload=1 - p2p_listen_reg_class=81 - p2p_listen_channel=1 - p2p_oper_reg_class=81 - p2p_oper_channel=1 - manufacturer=NixOS - model_name=NixOS_Unstable - model_number=2015 - ''; - description = '' - Configuration options for wpa_supplicant.conf. - Options defined here have precedence over options in configFile. - NOTE: Do not write sensitive data into extraConf as it will - be world-readable in the nix-store. For sensitive information - use the configFile instead. - ''; - }; - - extraCmdArgs = mkOption { - type = types.str; - default = ""; - example = "-e/var/run/wpa_supplicant/entropy.bin"; - description = - "Command line arguments to add when executing wpa_supplicant."; - }; - - driver = mkOption { - type = types.nullOr types.str; - default = "nl80211,wext"; - description = "Force a specific wpa_supplicant driver."; - }; - - bridge = mkOption { - type = types.str; - default = ""; - description = "Name of the bridge interface that wpa_supplicant should listen at."; - }; - - userControlled = { - - enable = mkOption { - type = types.bool; - default = false; - description = '' - Allow normal users to control wpa_supplicant through wpa_gui or wpa_cli. - This is useful for laptop users that switch networks a lot and don't want - to depend on a large package such as NetworkManager just to pick nearby - access points. - ''; - }; - - socketDir = mkOption { - type = types.str; - default = "/var/run/wpa_supplicant"; - description = "Directory of sockets for controlling wpa_supplicant."; - }; - - group = mkOption { - type = types.str; - default = "wheel"; - example = "network"; - description = "Members of this group can control wpa_supplicant."; - }; - - }; - - }; - }; };