nixos/*: hsphfpd support
This commit is contained in:
parent
0f83b301aa
commit
4d0ad2783d
@ -15,6 +15,8 @@ in {
|
|||||||
hardware.bluetooth = {
|
hardware.bluetooth = {
|
||||||
enable = mkEnableOption "support for Bluetooth";
|
enable = mkEnableOption "support for Bluetooth";
|
||||||
|
|
||||||
|
hsphfpd.enable = mkEnableOption "support for hsphfpd[-prototype] implementation";
|
||||||
|
|
||||||
powerOnBoot = mkOption {
|
powerOnBoot = mkOption {
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
default = true;
|
default = true;
|
||||||
@ -72,7 +74,8 @@ in {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.systemPackages = [ bluez-bluetooth ];
|
environment.systemPackages = [ bluez-bluetooth ]
|
||||||
|
++ optionals cfg.hsphfpd.enable [ pkgs.hsphfpd ];
|
||||||
|
|
||||||
environment.etc."bluetooth/main.conf"= {
|
environment.etc."bluetooth/main.conf"= {
|
||||||
source = pkgs.writeText "main.conf"
|
source = pkgs.writeText "main.conf"
|
||||||
@ -80,7 +83,8 @@ in {
|
|||||||
};
|
};
|
||||||
|
|
||||||
services.udev.packages = [ bluez-bluetooth ];
|
services.udev.packages = [ bluez-bluetooth ];
|
||||||
services.dbus.packages = [ bluez-bluetooth ];
|
services.dbus.packages = [ bluez-bluetooth ]
|
||||||
|
++ optionals cfg.hsphfpd.enable [ pkgs.hsphfpd ];
|
||||||
systemd.packages = [ bluez-bluetooth ];
|
systemd.packages = [ bluez-bluetooth ];
|
||||||
|
|
||||||
systemd.services = {
|
systemd.services = {
|
||||||
@ -90,11 +94,31 @@ in {
|
|||||||
# restarting can leave people without a mouse/keyboard
|
# restarting can leave people without a mouse/keyboard
|
||||||
unitConfig.X-RestartIfChanged = false;
|
unitConfig.X-RestartIfChanged = false;
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
// (optionalAttrs cfg.hsphfpd.enable {
|
||||||
|
hsphfpd = {
|
||||||
|
after = [ "bluetooth.service" ];
|
||||||
|
requires = [ "bluetooth.service" ];
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
|
description = "A prototype implementation used for connecting HSP/HFP Bluetooth devices";
|
||||||
|
serviceConfig.ExecStart = "${pkgs.hsphfpd}/bin/hsphfpd.pl";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
;
|
||||||
|
|
||||||
systemd.user.services = {
|
systemd.user.services = {
|
||||||
obex.aliases = [ "dbus-org.bluez.obex.service" ];
|
obex.aliases = [ "dbus-org.bluez.obex.service" ];
|
||||||
};
|
}
|
||||||
|
// (optionalAttrs cfg.hsphfpd.enable {
|
||||||
|
telephony_client = {
|
||||||
|
wantedBy = [ "default.target"];
|
||||||
|
|
||||||
|
description = "telephony_client for hsphfpd";
|
||||||
|
serviceConfig.ExecStart = "${pkgs.hsphfpd}/bin/telephony_client.pl";
|
||||||
|
};
|
||||||
|
})
|
||||||
|
;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user