Cheatsheet for all things Nix


Nix Language Manual
Nixpkgs Manual
NixOS Manual
How to Learn Nix Series
Nix Options
Nixpkgs options code
NixOS Wiki
Nix.dev
Contributing to nixpkgs, and language-build tools
MyNixOS
NixOS Guide
Nix 1-Pager
Nix flake starters
MacOS / nix-darwin
Using Nix on MacOS
Blog posts
Using Nix to skip install
To be expected: this will become rapidly out of date.
nix-repl --file '' -I nixos-config=/etc/nixos/configuration.nix Enter into existing NixOS config in the Nix repl. Then most values are prefixed with "config.", but can be inspected.
nix-env -qaPA nixpkgs.nodePackages To enumerate the list of Node Packages (should also work for emacsPackages, I think). Replace "nixpkgs" with "nixos" if you're on NixOS, I think.
nix-env -q will get you all the packages installed via nix-env (as opposed to installed via config files)
nix-env -e packagename will remove a package installed via nix-env
nix-info -mShow Nix configuration
nix show-configShow more Nix configuration
nixos-rebuild switch --option substitute false will allow you to switch static IP addresses without having network. Note that this only works if you haven't made any other package updates.
collision errorNix still only lets you have one version of a given software installed at a time, so root and userX can't have different versions of Emacs simultaneously, for instance.
readlink $(which emacs)To figure out where in the Nix store your current version of software is coming from, just follow the symlink.
bat .emacs.wrapperUse bat to see where any wrappers might be pointing (in this case, to find out where default.el is coming from)