From 93b0545d11bf8c7f065203f7f3eaf1d0e3730dce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Mon, 21 Feb 2022 21:54:09 +0100 Subject: Add initial version --- nixos/modules/wifi-client.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 nixos/modules/wifi-client.nix (limited to 'nixos/modules/wifi-client.nix') diff --git a/nixos/modules/wifi-client.nix b/nixos/modules/wifi-client.nix new file mode 100644 index 0000000..af09155 --- /dev/null +++ b/nixos/modules/wifi-client.nix @@ -0,0 +1,23 @@ +{ config, lib, pkgs, ... }: + +with lib; + +{ + + options = { + cynerd.wifiClient = mkOption { + type = types.bool; + default = false; + description = "Enable Wi-Fi client support"; + }; + }; + + config = mkIf config.cynerd.wifiClient { + networking.wireless = { + enable = true; + networks = config.secrets.wifiNetworks; + environmentFile = "/run/secrets/wifi.env"; + userControlled.enable = true; + }; + }; +} -- cgit v1.2.3