Polybar built with mpd support doesn't have mpd support

in configuration.nix:

environment.systemPackages = with pkgs; [
(polybar.override {
    mpdSupport = true;
})
...
];

polybar --version returns:

polybar 3.7.1

Features: +alsa -curl -i3 -mpd +network(libnl) -pulseaudio +xkeyboard

Therefore polybar says that there is no built-in support for ‘internal/mpd’

The polybar package in Nixpkgs looks correct to me, and so does your usage of it.

Perhaps the binary that you’re executing is not the one you think it is. Check /nix/store/ for other derivations of polybar and see if any of them are correct; ls /nix/store/*polybar*

I tried a nix-collect-garbage and then rebuilding but it shows the same thing.

Well, that’s definitely how it should be done:

https://github.com/NixOS/nixpkgs/blob/8b5a3d5a1d951344d683b442c0739010b80039db/pkgs/top-level/all-packages.nix#L32817-L32825

Maybe try out polybarFull, just to see if that comes with mpd support? Otherwise open a bug I think.

I also tried installing polybarFull and it also doesn’t have mpd enabled

I just checked, and looks like someone (dunno if it was you) opened an issue for exactly this it seems, so linking that here as well: Polybar built with mpd support doesn’t have mpd support · Issue #327025 · NixOS/nixpkgs · GitHub

I just rebuilt polybar with

pkgs.polybar.override { mpdSupport = true; }

and it gives me the following output:

$ ./result/bin/polybar --version
polybar 3.7.1

Features: +alsa -curl -i3 +mpd +network(libnl) -pulseaudio +xkeyboard

So it seems to work as it should. Are you sure you’re not installing another version of polybar in some way? Via the home-manager module, users.users.<username>.packages, nix-env --install, or nix profile install?

I woke up and received problem-solving skills previously unavailable to me. @olmokramer was also right about that. Except I didn’t really specify any package, but home-manager still used the wrong package. What I had in a home-manager module is services.polybar.enable = true, which seems to ignore what I had in configuration.nix. What I replaced it with is:

services.polybar.package = pkgs.polybar.override {
    mpdSupport = true;
    pulseSupport = true;
};