Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 1.04 KB

install_nix.md

File metadata and controls

42 lines (30 loc) · 1.04 KB

Nix Setup

If you don't already have nix set up on your machine, follow this steps!

Install nix

sh <(curl -L https://nixos.org/nix/install) --daemon

configure nix, adding some features that speed things up

mkdir -p ~/.config/nix/
echo -e 'max-jobs = auto\nexperimental-features = nix-command flakes' > ~/.config/nix/nix.conf

configure global nix caches

copy & paste the entire entry in your terminal:

sudo tee /etc/nix/nix.conf <<EOF
build-users-group = nixbld
substituters = https://cache.nixos.org/
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
EOF

NOTE: restart your terminal here!

Install and configure direnv + nix-direnv
nix-env -i direnv nix-direnv
echo  "source $HOME/.nix-profile/share/nix-direnv/direnvrc" >~/.direnvrc
echo  "[[ -f ~/.bashrc ]] && . ~/.bashrc" >~/.bash_profile
echo  'eval "$(direnv hook bash)"' >>~/.bashrc
echo  'eval "$(direnv hook zsh)"' >>~/.zshrc
NOTE: restart your terminal once more here!