Pacmd - No PulseAudio daemon running, or not running as session daemon

I have recently setup nixos with awesomewm where i have a component that controls sound via pacmd. However, the problem when trying to execute pacmd is that i haven’t been able to get it to work with Pipewire.

Here are my nix configs:

  # Enable sound with pipewire.
  sound.enable = false;
  hardware.pulseaudio.enable = false;
  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;

    # use the example session manager (no others are packaged yet so this is enabled by default,
    # no need to redefine it in your config for now)
    #media-session.enable = true;
  }; = [ pkgs.pulseaudio ];

I know about alternatives such as amixer but i’d like to get pacmd to work as well. Since pipewire promises seemless pulseaudio emulation, i would expect this to make tools like pacmd to work.

What does pacmd expect in terms of configs to work with pipewire?

What is broken exactly? Does not work is not much information to work with.

The error that i am seeing was mentioned in the title. Whenever i invoke pacmd list it would show me the following error:

No PulseAudio daemon running, or not running as session daemon

Is systemctl status --user pipewire-pulse.service outputing anything not normal?

Did you logout and back in after enabling pipewire?

Nothing out of the ordinary:

systemctl status --user pipewire-pulse.service
● pipewire-pulse.service - PipeWire PulseAudio
     Loaded: loaded (/etc/systemd/user/pipewire-pulse.service; disabled; vendor preset: enabled)
    Drop-In: /nix/store/l8a14whvgzzhqyd69bdj4q3wn767giz3-user-units/pipewire-pulse.service.d
     Active: active (running) since Wed 2022-08-03 10:59:08 EEST; 13h ago
TriggeredBy: ● pipewire-pulse.socket
   Main PID: 2294 (pipewire-pulse)
      Tasks: 2 (limit: 76848)
     Memory: 12.9M
        CPU: 7.587s
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/pipewire-pulse.service
             └─2294 /nix/store/gqj9l3msz45m02a0fmh19377mxiszzay-pipewire-0.3.51-pulse/bin/pipewire-pulse

Aug 03 10:59:08 nixos systemd[1657]: Started PipeWire PulseAudio.
Aug 03 10:59:08 nixos pipewire-pulse[2299]: 536870912

And yes, i’ve rebooted many times.

I tried adding pulseaudio to systemPackages so that i can have pacmd available and also tried using nix-shell -p pulseaudio to no avail.

Hosted by Flying Circus.