Files
nixos/modules/nixos/network.nix
2024-12-29 14:29:48 +01:00

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"];
};
}