grimm-nixos-laptop/common/network/bluetooth.nix

32 lines
652 B
Nix
Raw Normal View History

2024-05-07 23:31:41 +02:00
{
pkgs,
config,
lib,
...
}:
2024-04-10 16:51:28 +02:00
let
2024-05-11 22:55:59 +02:00
inherit (config.grimmShared)
enable
network
graphical
sound
;
2024-04-10 16:51:28 +02:00
in
{
2024-05-11 22:55:59 +02:00
config = lib.mkIf (enable && network && config.hardware.bluetooth.enable) {
services.blueman.enable = lib.mkIf graphical true;
2024-04-10 16:51:28 +02:00
2024-05-11 22:55:59 +02:00
environment.systemPackages = [ pkgs.bluetuith ] ++ lib.optional sound.enable pkgs.bluez;
2024-05-11 22:55:59 +02:00
systemd.user.services.mpris-proxy = lib.mkIf sound.enable {
description = "Mpris proxy";
after = [
"network.target"
"sound.target"
];
wantedBy = [ "default.target" ];
2024-09-21 09:43:57 +02:00
serviceConfig.ExecStart = lib.getExe' pkgs.bluez "mpris-proxy";
};
2024-05-11 22:55:59 +02:00
};
2024-03-24 16:59:47 +01:00
}