modules: networking: add 'wireless' option
This commit is contained in:
parent
a03db294fe
commit
376e60d71e
|
@ -1,7 +1,10 @@
|
||||||
{ lib, ... }:
|
{ config, lib, ... }:
|
||||||
|
let
|
||||||
|
cfg = config.my.networking;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
options.my.networking.externalInterface = with lib; mkOption {
|
options.my.networking = with lib; {
|
||||||
|
externalInterface = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = null;
|
||||||
example = "eth0";
|
example = "eth0";
|
||||||
|
@ -10,4 +13,15 @@
|
||||||
e.g. NATing internal networks.
|
e.g. NATing internal networks.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
wireless = {
|
||||||
|
enable = mkEnableOption "wireless configuration";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkMerge [
|
||||||
|
(lib.mkIf cfg.wireless.enable {
|
||||||
|
networking.networkmanager.enable = true;
|
||||||
|
})
|
||||||
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue