nixos/modules/hardware/sound.nix

26 lines
785 B
Nix
Raw Normal View History

2023-06-24 23:00:02 +08:00
inputs:
2023-06-05 21:53:13 +08:00
{
config =
{
2023-07-17 13:47:12 +08:00
sound.enable = true;
2023-06-05 21:53:13 +08:00
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire =
{
enable = true;
2023-06-14 19:08:42 +08:00
alsa = { enable = true; support32Bit = true; };
2023-06-05 21:53:13 +08:00
pulse.enable = true;
};
2023-07-17 13:47:12 +08:00
environment.etc."wireplumber/main.lua.d/50-alsa-config.lua".text =
let
content = builtins.readFile
("/." + inputs.pkgs.wireplumber + "/share/wireplumber/main.lua.d/50-alsa-config.lua");
matched = builtins.match ".*\n([[:space:]]*)(--\\[\"session\\.suspend-timeout-seconds\"][^\n]*)[\n].*" content;
spaces = builtins.elemAt matched 0;
comment = builtins.elemAt matched 1;
config = "[\"session.suspend-timeout-seconds\"] = 0";
in
builtins.replaceStrings [(spaces + comment)] [(spaces + config)] content;
2023-06-05 21:53:13 +08:00
};
}