27 lines
544 B
Nix
27 lines
544 B
Nix
{
|
|
lib,
|
|
config,
|
|
...
|
|
}: let
|
|
cfg = config.myConfig.network;
|
|
in {
|
|
options.myConfig.network = {
|
|
enable = lib.mkEnableOption "bluetooth";
|
|
hostName = lib.mkOption {
|
|
default = null;
|
|
example = "host";
|
|
description = "The host name of this machine";
|
|
type = lib.types.nullOr lib.types.nonEmptyStr;
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
networking = {
|
|
hostName = cfg.hostName;
|
|
firewall.enable = false;
|
|
};
|
|
|
|
users.users.${config.myConfig.user}.extraGroups = ["networkmanager"];
|
|
};
|
|
}
|