Skip to content

Instantly share code, notes, and snippets.

@ruandre
Last active Sep 13, 2021
Embed
What would you like to do?
nix on debian/ubuntu (incl. wsl)
# info source: https://ariya.io/2020/05/nix-package-manager-on-ubuntu-or-debian
# 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 https://nixos.org/nix/install) --no-daemon
nix-env -i hello # to test
nix-env --uninstall hello # remove
# tips:
nix-env -qa > nix-packages.list # easy to grep; otherwise https://search.nixos.org/packages
nix-env -i neovim # example, see: https://nixos.org/nix/manual
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