Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nix: what's the concrete difference between nixpkgs and nixpkgs.pkgs?

Tags:

nix

In:

n = import <nixpkgs> {};

n contains an attribute n.pkgs, which also seems to contain all the available packages. What's the difference then between n and n.pkgs?

It seems it's related to the fixpoint semantics of Nix configuration and the availability to override some packages from nixpkgs, but I can't really wrap my head around it and find a clear distinction.

like image 706
Yves Parès Avatar asked Oct 20 '15 10:10

Yves Parès


1 Answers

import <nixpkgs> {} gives you a pristine instance of Nixpkgs, i.e. without any user-configuration applied.

(import <nixpkgs> {}).pkgs gives you a version of Nixpkgs that has user-configured settings and overrides from ~/.nixpkgs/config.nix applied.

like image 89
Peter Simons Avatar answered Sep 27 '22 18:09

Peter Simons