ditoslav
ditoslav

Reputation: 4892

What is buildPackages in Nix?

So I'm browsing through a proprietary nix codebase and I'm trying to make sense of it. It is building rust packages among other things. There is this autogenerated nix code using crate2nix which among other things invokes nixpkgs.buildPackages. After googling this expression I get very random results about people using this for compiling many languages but I cannot find a single case of some doc mentioning this? Is this some builting nix expression? Where is it documented?

Upvotes: 4

Views: 1529

Answers (1)

womfoo
womfoo

Reputation: 61

This looks like a package set to explicitly reference all packages built on the host during cross-compilation (see pkgs/top-level/stage.nix).

$ nix repl
Welcome to Nix version 2.3.10. Type :? for help.

nix-repl> :l <nixpkgs>
Added 13917 variables.

nix-repl> :t buildPackages
a set

nix-repl> builtins.length (builtins.attrNames buildPackages)
13918

nix-repl> lib.lists.take 20 (builtins.attrNames buildPackages)
[ "AAAAAASomeThingsFailToEvaluate" "AMB-plugins" "ArchiSteamFarm" "AusweisApp2" "CHOWTapeModel" "CoinMP" "DisnixWebService" "EBTKS" "EmptyEpsilon" "FIL-plugins" "Fabric" "LAStools" "LASzip" "LASzip2" "Literate" "MACS2" "MIDIVisualizer" "MMA" "NSPlist" "OSCAR" ]

Upvotes: 6

Related Questions