diff --git a/hosts/common/system/audio.nix b/hosts/common/system/audio.nix deleted file mode 100644 index 40b3cb3..0000000 --- a/hosts/common/system/audio.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ ... }: - -{ - hardware.pulseaudio.enable = false; - # 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; - }; -} diff --git a/hosts/common/system/default.nix b/hosts/common/system/default.nix index 627ce0b..643e19e 100644 --- a/hosts/common/system/default.nix +++ b/hosts/common/system/default.nix @@ -4,7 +4,6 @@ _: imports = [ ./core.nix ./boot.nix - ./audio.nix ./locale.nix ./packages.nix ./printing.nix diff --git a/hosts/solaire/default.nix b/hosts/solaire/default.nix index dd636e2..f6ef2f3 100644 --- a/hosts/solaire/default.nix +++ b/hosts/solaire/default.nix @@ -37,6 +37,7 @@ modules.stylix.enable = true; modules.nvidia.enable = true; modules.gaming.enable = true; + modules.pipewire.enable = true; stylix.image = ../../wallpapers/lucy-edgerunners-wallpaper.jpg; } diff --git a/modules/default.nix b/modules/default.nix index 1242244..4ef3485 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -1,6 +1,7 @@ _: { imports = [ + ./pipewire.nix ./nvidia.nix ./gnome.nix ./gaming.nix diff --git a/modules/pipewire.nix b/modules/pipewire.nix new file mode 100644 index 0000000..2c191d8 --- /dev/null +++ b/modules/pipewire.nix @@ -0,0 +1,30 @@ +{ config, lib, ... }: + +let + cfg = config.modules.pipewire; +in + { + options.modules.pipewire.enable = lib.mkEnableOption "pipewire module"; + config = lib.mkIf cfg.enable { + hardware.pulseaudio.enable = false; + # 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; + }; + + services.pipewire.extraConfig.pipewire."92-low-latency" = { + "context.properties" = { + "default.clock.rate" = 48000; + "default.clock.quantum" = 32; + "default.clock.min-quantum" = 32; + "default.clock.max-quantum" = 32; + }; + }; + }; +}