diff --git a/hosts/iron/services/default.nix b/hosts/iron/services/default.nix index c0523da..94f5ccb 100644 --- a/hosts/iron/services/default.nix +++ b/hosts/iron/services/default.nix @@ -7,18 +7,15 @@ ./esphome ./home-assistant.nix ./jellyfin.nix - ./ledfx.nix ./mail.nix ./matrix.nix - ./mopidy.nix ./navidrome.nix ./nginx.nix ./ntp.nix ./public-ip-tunnel.nix ./radicale.nix ./remarkable.nix - ./snapclient.nix - ./snapserver.nix + ./snapcast ./sturzbach.nix ./tts.nix ./unifi-controller.nix diff --git a/hosts/iron/services/snapcast/alsa.nix b/hosts/iron/services/snapcast/alsa.nix new file mode 100644 index 0000000..1b8566e --- /dev/null +++ b/hosts/iron/services/snapcast/alsa.nix @@ -0,0 +1,6 @@ +{ + boot.kernelModules = [ "snd-aloop" ]; + boot.extraModprobeConfig = '' + options snd-aloop id=ledfx,bluetooth enable=1,1 pcm_substreams=2,2 + ''; +} diff --git a/hosts/iron/services/snapcast/bluetooth-sink.nix b/hosts/iron/services/snapcast/bluetooth-sink.nix new file mode 100644 index 0000000..77418a4 --- /dev/null +++ b/hosts/iron/services/snapcast/bluetooth-sink.nix @@ -0,0 +1,77 @@ +{ pkgs, ... }: +{ + environment.systemPackages = with pkgs; [ + bluez-alsa + ]; + + hardware.bluetooth = { + enable = true; + settings = { + General = { + Enable = "Source,Sink,Media,Socket"; + Class = "0x00041C"; + # Pairing always on + AlwaysPairable = "true"; + # Don't disable discoverability after timeout + DiscoverableTimeout = "0"; + # Faster but uses more power + FastConnectable = "true"; + # Allow repairing of existing devices + JustWorksRepairing = "always"; + }; + }; + }; + + services.blueman.enable = true; + + systemd.services.bluetooth-auto-pair = { + wantedBy = [ + "bluetooth.service" + ]; + after = [ + "bluetooth.service" + ]; + bindsTo = [ + "bluetooth.service" + ]; + serviceConfig = { + Type = "simple"; + ExecStart = pkgs.writeShellScript "exec-start" '' + ${pkgs.bluez}/bin/bluetoothctl <