2
0
Fork 0

feat: Disable bluetooth when not in use

This commit is contained in:
lwad 2024-06-02 14:45:33 +01:00
parent d65ff34c38
commit 5298ff9074
3 changed files with 11 additions and 3 deletions

View file

@ -12,6 +12,7 @@
bluetooth = {
disabledPlugins = [ "input" ];
enable = true;
powerOnBoot = false;
};
nvidia = {
modesetting.enable = true;

View file

@ -412,6 +412,8 @@ in {
address="$(select_device)"
if ${test} -n "$address"; then
${bluetoothctl} power on
disconnect_other "$address"
remaining_connection_attempts=3
@ -486,9 +488,13 @@ in {
};
wireshark.enable = true;
};
services.unclutter-xfixes = {
enable = lib.mkDefault true;
timeout = 1;
services = {
udev.extraRules = ''
ACTION=="remove", SUBSYSTEM=="bluetooth", RUN="${pkgs.bluez}/bin/bluetoothctl power off"'';
unclutter-xfixes = {
enable = lib.mkDefault true;
timeout = 1;
};
};
users.users.lukew.extraGroups = [ "wireshark" ];
xdg.mime.defaultApplications = lib.genAttrs [

View file

@ -4,6 +4,7 @@
hardware.bluetooth = {
disabledPlugins = [ "input" ];
enable = true;
powerOnBoot = false;
};
home-manager.users.lukew = {
home.stateVersion = "23.11";