I can’t seem to get sound to work on nixos. Any pactl command results in:
Connection failure: Connection refused
pa_context_connect() failed: Connection refused
the sound related settings in configuration.nix are:
sound.enable = true;
hardware.pulseaudio.enable = true;
Any help appreciated.
It never occurred to me to do what you did.
In case anyone else has problems and stumbles on this question, my problem was solved by removing
~/.config/pulse. It was a symlink to a file that had since been deleted, which understandably caused problems.
systemctl --failed --user showed that
pulseaudio.socket had failed. Checking
journalctl --user -u pulseaudio.service had this line:
Oct 16 06:42:36 mars pulseaudio: E: [pulseaudio] core-util.c: Failed to create secure directory (/home/alex/.config/pulse): Too many levels of symbolic links
which made me go look at that.