add bluetooth mac service

This commit is contained in:
Adam Stephens 2024-05-14 15:33:45 -04:00
parent e0cc11fd56
commit 9f5d708f1a
No known key found for this signature in database

View file

@ -26,7 +26,7 @@ in
bluetoothMac = lib.mkOption { bluetoothMac = lib.mkOption {
type = lib.types.str; type = lib.types.str;
description = "mac address to set on boot"; description = "Bluetooth MAC address to set on boot";
}; };
kernel = lib.mkOption { kernel = lib.mkOption {
@ -34,7 +34,7 @@ in
"jhovold" "jhovold"
"mainline" "mainline"
]; ];
description = "which patched kernel to use. jhovold is the latest RC, and mainline is nixos latest"; description = "Which patched kernel to use. jhovold is the latest RC or release with some x13s specific patches, and mainline is nixos latest";
default = "jhovold"; default = "jhovold";
}; };
}; };
@ -119,17 +119,16 @@ in
# default is performance # default is performance
powerManagement.cpuFreqGovernor = "ondemand"; powerManagement.cpuFreqGovernor = "ondemand";
systemd.services.bluetooth = { systemd.services.bluetooth-x13s-mac = {
wantedBy = [ "multi-user.target" ];
before = [ "bluetooth.service" ];
requiredBy = [ "bluetooth.service" ];
serviceConfig = { serviceConfig = {
# disabled because btmgmt call hangs Type = "oneshot";
# ExecStartPre = [ RemainAfterExit = true;
# "" StandardInput = "tty";
# "${pkgs.util-linux}/bin/rfkill block bluetooth" ExecStart = "${pkgs.bluez5-experimental}/bin/btmgmt public-addr ${cfg.bluetoothMac}";
# "${pkgs.bluez5-experimental}/bin/btmgmt public-addr ${cfg.bluetoothMac}"
# "${pkgs.util-linux}/bin/rfkill unblock bluetooth"
# ];
RestartSec = 5;
Restart = "on-failure";
}; };
}; };
}; };