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; + }; + }; }; }