added pipewire and pulseaudio to system

This commit is contained in:
Sven Vogel 2023-12-21 21:31:25 +01:00
parent ab21bce48d
commit 052ae88a78
4 changed files with 48 additions and 1 deletions

View File

@ -99,4 +99,16 @@ with import <nixpkgs> {}; {
prismlauncher = true; prismlauncher = true;
steam = true; steam = true;
}; };
sound = {
pipewire = {
enable = true;
alsa = true;
pulse = true;
jack = true;
};
pulseaudio = {
enable = false;
};
};
} }

View File

@ -1,7 +1,12 @@
{ lib, ... }:
let
settings = import ./../settings.nix;
in
{ {
imports = [ imports = [
./grub.nix ./grub.nix
./kernel.nix ./kernel.nix
./networking.nix ./networking.nix
]; ] ++ lib.optionals settings.sound.pipewire.enable [ ./pipewire.nix ]
++ lib.optionals settings.sound.pulseaudio.enable [ ./pulseaudio.nix ];
} }

22
system/pipewire.nix Normal file
View File

@ -0,0 +1,22 @@
{ pkgs, lib, ... }:
let
settings = import ./../settings.nix;
in
{
# Remove sound.enable or set it to false if you had it set previously, as sound.enable is only meant for ALSA-based configurations
sound.enable = false;
# rtkit is optional but recommended
security.rtkit.enable = true;
services.pipewire = {
enable = settings.sound.pipewire.enable;
audio.enable = settings.sound.pipewire.enable;
pulse.enable = settings.sound.pipewire.pulse;
jack.enable = settings.sound.pipewire.jack;
alsa = {
enable = settings.sound.pipewire.alsa;
support32Bit = true;
};
};
}

8
system/pulseaudio.nix Normal file
View File

@ -0,0 +1,8 @@
{ pkgs, lib, ... }:
let
settings = import ./../settings.nix;
in
{
hardware.pulseaudio.enable = true;
hardware.pulseaudio.support32Bit = true; ## If compatibility with 32-bit applications is desired.
}