{ config, pkgs, lib, ... }: let cfg = config.ctucxConfig.configure.bluetooth; in { options = { ctucxConfig.configure.bluetooth = lib.mkEnableOption "bluetooth"; }; config = lib.mkIf cfg { hardware.bluetooth = { enable = true; powerOnBoot = false; }; services.blueman = { enable = true; }; home-manager.users.leah = { home.packages = [ pkgs.blueman ]; xdg = { desktopEntries = { blueman-adapters = { name = "Bluetooth Adapters"; settings = { NoDisplay = "true"; }; }; }; }; wayland.windowManager.sway.config.startup = [ { always = true; command = "systemctl --user restart blueman-applet"; } ]; systemd.user.services = { blueman-applet = { Unit = { Description = "Blueman applet"; Requires = [ "waybar.service" ]; After = [ "graphical-session-pre.target" "tray.target" ]; PartOf = [ "graphical-session.target" ]; }; Service.ExecStart = "${pkgs.blueman}/bin/blueman-applet"; Install.WantedBy = [ "graphical-session.target" ]; }; mpris-proxy = { Unit = { Description = "Mpris proxy"; After = [ "network.target" "sound.target" ]; }; Service.ExecStart = "${pkgs.bluez}/bin/mpris-proxy"; Install.WantedBy = [ "default.target" ]; }; }; }; }; }