nixfiles/hosts/raspberry/services/music-friend/bluetooth.nix
ChaotiCryptidz 184afea0ee idfk
2022-01-29 18:06:26 +00:00

25 lines
594 B
Nix

{ tree, pkgs, ... }: {
imports = with tree; [
profiles.connectivity.bluetooth
profiles.sound.pulseaudio.pulse-bluetooth
];
systemd = {
timers.bt-autoconnect = {
wantedBy = [ "timers.target" ];
partOf = [ "bt-autoconnect.service" ];
timerConfig.OnCalendar = "minutely";
};
services.bt-autoconnect = {
serviceConfig.Type = "oneshot";
script = ''
${pkgs.bluez}/bin/bluetoothctl connect 3E:39:E7:B2:86:29 || true
'';
};
};
hardware.pulseaudio.extraConfig = ''
set-default-sink bluez_card.3E_39_E7_B2_86_29
'';
}