Skip to content

Instantly share code, notes, and snippets.

Last active Sep 13, 2021
What would you like to do?
nix on debian/ubuntu (incl. wsl)
# info source:
# install these if not already available
sudo get install curl xz-utils
# or (gcc et al, includes xz-utils)
sudo get install curl build-essential
sudo mkdir /nix
sudo chown username /nix # replace username with own
sh <(curl -L --no-daemon
nix-env -i hello # to test
nix-env --uninstall hello # remove
# tips:
nix-env -qa > nix-packages.list # easy to grep; otherwise
nix-env -i neovim # example, see:
nix-store --optimise -v # optimise store
# auto-optimise store when writing new files to it:
mkdir -p ~/.config/nix
echo "auto-optimise-store = true" >> ~/.config/nix/nix.conf
# faster to type:
alias nxi='nix-env -i' # install
alias nxu='nix-env -u' # update
alias nxr='nix-env -e' # remove
alias nxls='nix-env -q' # list
alias nxgc='nix-collect-garbage -d'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment