grimm-nixos-laptop/common/network/bluetooth.nix
2024-05-07 23:31:41 +02:00

29 lines
639 B
Nix

{
pkgs,
config,
lib,
...
}:
let
cfg = config.grimmShared;
in
{
config =
with cfg;
lib.mkIf (enable && network && config.hardware.bluetooth.enable) {
services.blueman.enable = lib.mkIf graphical true;
environment.systemPackages = with pkgs; [ bluetuith ] ++ lib.optional sound.enable pkgs.bluez;
systemd.user.services.mpris-proxy = lib.mkIf sound.enable {
description = "Mpris proxy";
after = [
"network.target"
"sound.target"
];
wantedBy = [ "default.target" ];
serviceConfig.ExecStart = "${pkgs.bluez}/bin/mpris-proxy";
};
};
}