From 8013120856341a929ad61fd0fb94ab7dd8d22a8f Mon Sep 17 00:00:00 2001 From: Bruno BELANYI Date: Wed, 5 May 2021 12:27:07 +0200 Subject: [PATCH] modules: networking: add 'wireless' option --- modules/networking.nix | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/modules/networking.nix b/modules/networking.nix index 28ba108..99e1ef3 100644 --- a/modules/networking.nix +++ b/modules/networking.nix @@ -1,13 +1,27 @@ -{ lib, ... }: - +{ config, lib, ... }: +let + cfg = config.my.networking; +in { - options.my.networking.externalInterface = with lib; mkOption { - type = types.nullOr types.str; - default = null; - example = "eth0"; - description = '' - Name of the network interface that egresses to the internet. Used for - e.g. NATing internal networks. - ''; + options.my.networking = with lib; { + externalInterface = mkOption { + type = types.nullOr types.str; + default = null; + example = "eth0"; + description = '' + Name of the network interface that egresses to the internet. Used for + e.g. NATing internal networks. + ''; + }; + + wireless = { + enable = mkEnableOption "wireless configuration"; + }; }; + + config = lib.mkMerge [ + (lib.mkIf cfg.wireless.enable { + networking.networkmanager.enable = true; + }) + ]; }