Skip to content

Instantly share code, notes, and snippets.

@berdario
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berdario/39e95932a200ce67c8a9 to your computer and use it in GitHub Desktop.
Save berdario/39e95932a200ce67c8a9 to your computer and use it in GitHub Desktop.
Nix notes

It's been a while since I started to use Nixos, and I promised myself to improve the documentation/wiki, but since I haven't overcome yet the barrier of entry to that, and some of the information that I discovered/asked on irc/etc might otherwise be forgotten, I'll temporarily keep track of it here:

  • Don't rely too much on nix-shell/nix-build: the Phases will kick you out of the shell if an error happens, and you won't be able to load the correct scripts, I reported this here but I'll probably need to add some more details
  • Apparently there's no way to see software that is available for another platform (this would be useful in a porting effort): you have to manually grep nixpkgs yourself
  • There's no way to do a partial match query on nix-env: just nix-env -qaP "*" and grep it
  • The nix manual is seriously paltry when discussing the Nix language itself: some operators aren't even mentioned (e.g. <)
  • If you want to play around with the Nix language itself, nix-repl and when inside: there are some builtins, but you'll want to add :l /path/to/nixpkgs, then you can play with the functions defined there, e.g. for intersperse: `stdenv.lib.intersperse 2 [1 3]``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment