Disable audio card's power saving function

Hi, would someone be able to tell me how to do this on NixOS? Basically the equivalent to this:
“How to disable power savings in Linux”

The clicking of the audio being turned off and on is gonna drive me insane

Use hardware.pulseaudio.extraConfig.

Right, back again, still trying to figure this out. I am using pipewire at the moment, do I have to include the entire 50-alsa-config.lua in the configuration.nix to apply the single change of this
–[“session.suspend-timeout-seconds”] = 5, – 0 disables suspend
to this?
[“session.suspend-timeout-seconds”] = 0, – default is 5

Or am I able to have a smaller change?

hardware.pulseaudio.extraConfig is not meant for lua configs. It is meant for something like this:

# Save power
hardware.pulseaudio.extraConfig = ''
  load-module module-suspend-on-idle
'';

Which is not lua, but a special syntax of pulseaudio. If you are looking to write config for pipewire with lua, it seems NixOS’ module doesn’t support this out of the box as of today, but it might be that what you are trying to achieve can be achieved with the current NixOS module’s API, but I’m not sure.

In the link you gave, there are instructions for pulseaudio, so that’s what I suggested my help with it. With Pipewire I’m not experienced.