aboutsummaryrefslogtreecommitdiff
path: root/nixos/modules/wifi-client.nix
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-02-21 21:54:09 +0100
committerKarel Kočí <cynerd@email.cz>2022-06-10 14:05:48 +0200
commit93b0545d11bf8c7f065203f7f3eaf1d0e3730dce (patch)
treeda93fa5fcd14c493d8ccd86c98f40d26c9697869 /nixos/modules/wifi-client.nix
downloadnixos-personal-93b0545d11bf8c7f065203f7f3eaf1d0e3730dce.tar.gz
nixos-personal-93b0545d11bf8c7f065203f7f3eaf1d0e3730dce.tar.bz2
nixos-personal-93b0545d11bf8c7f065203f7f3eaf1d0e3730dce.zip
Add initial version
Diffstat (limited to 'nixos/modules/wifi-client.nix')
-rw-r--r--nixos/modules/wifi-client.nix23
1 files changed, 23 insertions, 0 deletions
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;
+ };
+ };
+}