fix wireplump config

This commit is contained in:
2023-07-17 13:47:12 +08:00
parent 353f601ba6
commit 02491d1246

View File

@@ -2,11 +2,7 @@ inputs:
{
config =
{
sound =
{
enable = true;
extraConfig = "session.suspend-timeout-seconds 0";
};
sound.enable = true;
hardware.pulseaudio.enable = false;
security.rtkit.enable = true;
services.pipewire =
@@ -15,5 +11,15 @@ inputs:
alsa = { enable = true; support32Bit = true; };
pulse.enable = true;
};
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;
};
}