commit then think
This commit is contained in:
21
modules/nixos/system/wireless/bluetooth.nix
Normal file
21
modules/nixos/system/wireless/bluetooth.nix
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
# pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.wireless.bluetooth;
|
||||
in {
|
||||
options = {
|
||||
wireless.bluetooth = {
|
||||
enable = mkEnableOption "enable bluetooth";
|
||||
enableBlueman = mkEnableOption "enable bluetooth manager";
|
||||
};
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
hardware.bluetooth.enable = true;
|
||||
hardware.bluetooth.powerOnBoot = true;
|
||||
services.blueman.enable = cfg.enableBlueman;
|
||||
};
|
||||
}
|
6
modules/nixos/system/wireless/main.nix
Normal file
6
modules/nixos/system/wireless/main.nix
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
imports = [
|
||||
./bluetooth.nix
|
||||
./wifi.nix
|
||||
];
|
||||
}
|
29
modules/nixos/system/wireless/wifi.nix
Normal file
29
modules/nixos/system/wireless/wifi.nix
Normal file
@ -0,0 +1,29 @@
|
||||
{
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.wireless.wifi;
|
||||
in {
|
||||
options = {
|
||||
wireless.wifi.enable =
|
||||
mkEnableOption "enables wifi with iwd and MAC address randomisation";
|
||||
};
|
||||
config = mkIf cfg.enable {
|
||||
networking = {
|
||||
networkmanager.wifi.backend = "iwd";
|
||||
wireless.iwd = {
|
||||
enable = true;
|
||||
settings = {
|
||||
General = {
|
||||
AddressRandomization = "network";
|
||||
};
|
||||
Settings = {
|
||||
AlwaysRandomizeAddress = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user