Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is buildPackages in Nix?

Tags:

nix

nixos

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?

like image 656
ditoslav Avatar asked Oct 19 '25 23:10

ditoslav


1 Answers

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" ]
like image 94
womfoo Avatar answered Oct 21 '25 20:10

womfoo