From e98a037497b4919c547e6914a6a5706312169311 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 17 Mar 2022 23:41:24 +0100 Subject: [PATCH] config/audio-server: allow bluetooth from all --- config/audio-server/default.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/config/audio-server/default.nix b/config/audio-server/default.nix index ed9139e0..d5c3f72f 100644 --- a/config/audio-server/default.nix +++ b/config/audio-server/default.nix @@ -48,5 +48,18 @@ userServices = true; }; }; + + systemd.services.bluetooth-agent = lib.mkIf config.hardware.bluetooth.enable { + description = "Allow anyone to pair via Bluetooth"; + wantedBy = [ "multi-user.target" ]; + requires = [ "bluetooth.target" ]; + after = [ "bluetooth.service" ]; + serviceConfig = { + Type = "simple"; + ExecStart = "${pkgs.bluez-tools}/bin/bt-agent -c NoInputNoOutput"; + Restart = "on-failure"; + RestartSec = 60; + }; + }; }; }