2023-01-20 04:25:08 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
2023-07-02 22:42:52 +00:00
|
|
|
let
|
|
|
|
install-bluetooth = pkgs.static-nix-shell.mkBash {
|
|
|
|
pname = "install-bluetooth";
|
2023-07-02 22:49:17 +00:00
|
|
|
src = ./.;
|
2023-07-02 22:42:52 +00:00
|
|
|
pkgs = [ "gnused" ];
|
|
|
|
};
|
|
|
|
in
|
2023-01-20 04:25:08 +00:00
|
|
|
{
|
|
|
|
config = lib.mkIf config.sane.roles.client {
|
|
|
|
# persist external pairings by default
|
2023-11-08 15:32:50 +00:00
|
|
|
sane.persist.sys.byStore.plaintext = [ "/var/lib/bluetooth" ];
|
2023-01-20 04:25:08 +00:00
|
|
|
|
|
|
|
sane.fs."/var/lib/bluetooth".generated.acl.mode = "0700";
|
|
|
|
sane.fs."/var/lib/bluetooth/.secrets.stamp" = {
|
|
|
|
wantedBeforeBy = [ "bluetooth.service" ];
|
2023-07-08 11:14:55 +00:00
|
|
|
generated.command = [
|
2023-07-08 10:56:24 +00:00
|
|
|
"${install-bluetooth}/bin/install-bluetooth"
|
|
|
|
"/run/secrets/bt"
|
|
|
|
""
|
|
|
|
"/var/lib/bluetooth/.secrets.stamp"
|
|
|
|
];
|
2023-01-20 04:25:08 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|