Cannot rebuild! Mysterious missing package error

My configuration that used to build no longer does.
I didn’t think that was supposed to be possible in NixOS.

I keep getting a No package 'alsa' found error,
but I don’t know where it’s coming from.

I tried building under a few different conditions,
and have retained trace files from each attempt.

I documented the problem in more detail, and inicluded the trace files,
here.

lazamar’s Nix Package Versions tool brings up one revision that contains a package named alsa… maybe that helps?

Thanks!

I don’t understand. Should I switch my nixpkgs channel to target that particular revision of nixpkgs? I don’t see how to do that. Or should I write an override to install alsa alone from that version of nixpkgs, and otherwise use nixpkgs-unstable? Something like this?.

I had imagined the thing to do would be to find the recipe that is requesting a nonexistent package, and fix that recipe. But I don’t understand how to read the traces to determine what was making the request.

Also, aside from procedures to correct the problem, what might have happened? I thought the primary advantage of NixOS was that your configuration was future-proof. But something appears to have changed procedurally, with the result that now my declarative config doesn’t do what it used to.

I just tried to explore that revision of nixpkgs in the repl, and it didn’t seem to have alsa… not sure what’s going on.
Could be a similar issue?

[rkb@nixos:~]$ nix repl '<nixpkgs>'
Welcome to Nix version 2.3.7. Type :? for help.

Loading '<nixpkgs>'...
Added 12102 variables.

nix-repl> pkgsWithAlsa = import (pkgs.fetchFromGitHub {
              name = "pkgs-with-alsa";
              owner = "nixos";
              repo = "nixpkgs-channels";
              rev = "fa54dd346fe5e73d877f2068addf6372608c820b";
              sha256 = "1428qilgk9h9w0lka0xmjnrkllyz16kny1afz3asr0qnr63wyzdk";
            }) { }

nix-repl> pkgsWithAlsa.alsa                                                    
error: attribute 'alsa' missing, at (string):1:1

nix-repl>

Or should I write an override to install alsa alone from that version of nixpkgs, and otherwise use nixpkgs-unstable? Something like this?.

That example should work.


Re-reading the trace, it could be that the missing package is not a Nix package, but a “pkg-config” one? I know little about cmake and pkg-config, but this person’s issue sounds similar…

1 Like