Skip to content

Instantly share code, notes, and snippets.

@FRidh
Created August 8, 2015 15:18
Show Gist options
  • Save FRidh/9d6e7afac488ac34b8af to your computer and use it in GitHub Desktop.
Save FRidh/9d6e7afac488ac34b8af to your computer and use it in GitHub Desktop.

Nix cheatsheet

Maintenance

Updating package channels is done with sudo nix-channel --update

Rebuilding the main system is done with sudo nixos-rebuild switch and upgrading with sudo nixos-rebuild switch --upgrade

Garbage is collected with sudo nix-collect-garbage -D

Installing packages

A package can be installed for the current user with nix-env -iA pkgs.Python34Packages.pandas

Nox can also be used nox pandas

Development

nix-shell

Open a nix-shell with a one or multiple packages nix-shell -p python34Packages.pandas python34Packages.scipy

Open a nix-shell with one or multiple packages based on a modified nixpkgs repository nix-shell -I nixpkgs=/path/to/nixpkgs -p python34Packages.newpackage python34Packages.pandas

Review packages

To test whether all dependents still function with the new package, you can use nox-review wip if the changes haven't been commited yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment