mirror of
https://codeberg.org/mart-w/nixos-x13s.git
synced 2024-11-24 07:54:48 +01:00
add bluetooth mac service
This commit is contained in:
parent
e0cc11fd56
commit
9f5d708f1a
23
module.nix
23
module.nix
|
@ -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";
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue