nixos-config/profiles/bluetooth.nix

29 lines
875 B
Nix
Raw Normal View History

2021-11-24 22:05:33 +04:00
{ pkgs, lib, config, ... }: {
2021-11-23 12:33:00 +04:00
hardware.bluetooth = {
enable = true;
2022-10-10 17:28:36 +04:00
package = pkgs.bluez;
2021-11-23 12:33:00 +04:00
};
systemd.services.bluetooth.serviceConfig.ExecStart = lib.mkForce [
""
2022-10-10 17:28:36 +04:00
"${pkgs.bluez}/libexec/bluetooth/bluetoothd -f /etc/bluetooth/main.conf -E"
2021-11-23 12:33:00 +04:00
];
persist.state.directories = [ "/var/lib/bluetooth" ];
2021-11-24 22:05:33 +04:00
home-manager.users.balsoft = let headphones = "CC:98:8B:C0:FC:D2";
in {
programs.zsh.shellAliases = {
"hpc" = "bluetoothctl connect ${headphones}";
"hpd" = "bluetoothctl disconnect ${headphones}";
};
wayland.windowManager.sway.config.keybindings = let
inherit (config.home-manager.users.balsoft.wayland.windowManager.sway.config)
modifier;
in {
"${modifier}+F2" = "exec bluetoothctl connect ${headphones}";
"${modifier}+Shift+F2" = "exec bluetoothctl disconnect ${headphones}";
};
};
2021-11-23 12:33:00 +04:00
}