diff --git a/common/default.nix b/common/default.nix index 59b4765..4d9bb2b 100644 --- a/common/default.nix +++ b/common/default.nix @@ -131,26 +131,11 @@ in extraBackends = [ pkgs.hplip ]; }; - # Enable sound. - hardware.pulseaudio = { - enable = true; - # decouple pulseaudio application and sink volumes - daemon.config = { - flat-volumes = "no"; - }; - # C3D2 hq music - zeroconf.discovery.enable = true; - zeroconf.publish.enable = true; - }; - # Bluetooth hardware.bluetooth = { enable = true; settings.General.Disable = "Headset"; # disable headset profile }; - hardware.pulseaudio = { - package = pkgs.pulseaudioFull; - }; # FIXME: at some point, hide GUI and sound (desktop vs. server) behind an option # Enable the X11 windowing system. diff --git a/common/pipewire.nix b/common/pipewire.nix new file mode 100644 index 0000000..cf9a01f --- /dev/null +++ b/common/pipewire.nix @@ -0,0 +1,26 @@ +{ pkgs, ... }: +{ + # rtkit is optional but recommended + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + # If you want to use JACK applications, uncomment this + #jack.enable = true; + }; + environment.systemPackages = [ pkgs.easyeffects ]; + + # TODO: can be done in a simpler way in 24.05, see wiki.nixos.org + environment.etc = { + "wireplumber/bluetooth.lua.d/51-bluez-config.lua".text = '' + bluez_monitor.properties = { + ["bluez5.enable-sbc-xq"] = true, + ["bluez5.enable-msbc"] = true, + ["bluez5.enable-hw-volume"] = true, + ["bluez5.headset-roles"] = "[ hsp_hs hsp_ag hfp_hf hfp_ag ]" + } + ''; + }; +} diff --git a/common/pulseaudio.nix b/common/pulseaudio.nix new file mode 100644 index 0000000..6ca211a --- /dev/null +++ b/common/pulseaudio.nix @@ -0,0 +1,15 @@ +{ pkgs, ... }: +{ + # Enable sound. + hardware.pulseaudio = { + enable = true; + package = pkgs.pulseaudioFull; + # decouple pulseaudio application and sink volumes + daemon.config = { + flat-volumes = "no"; + }; + # C3D2 hq music + zeroconf.discovery.enable = true; + zeroconf.publish.enable = true; + }; +} diff --git a/hosts/framenix/default.nix b/hosts/framenix/default.nix index 13c526d..de8c815 100644 --- a/hosts/framenix/default.nix +++ b/hosts/framenix/default.nix @@ -11,6 +11,7 @@ in { imports = [ ../../common + ../../common/pipewire.nix ./hardware-configuration.nix ./storage.nix @@ -26,7 +27,7 @@ in systemd.services.nix-daemon.environment.TMPDIR = "/var/tmp"; # try newer kernels - boot.kernelPackages = pkgs.linuxPackages_6_8; # FIXME: virtualbox not yet compatible with 6.9 + boot.kernelPackages = pkgs.linuxPackages_6_8; # FIXME: virtualbox not yet compatible with 6.9 boot.kernelParams = [ # powersave diff --git a/hosts/thinknix/default.nix b/hosts/thinknix/default.nix index a7344b4..518f8ce 100644 --- a/hosts/thinknix/default.nix +++ b/hosts/thinknix/default.nix @@ -7,6 +7,7 @@ { imports = [ ../../common + ../../common/pulseaudio.nix ./hardware-configuration.nix ./storage.nix