-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnixup.sh
20 lines (16 loc) · 870 Bytes
/
nixup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
# shellcheck disable=all
{ # Prevent execution if this script was only partially downloaded
sh <(curl -L https://nixos.org/nix/install) --daemon
# configure nix, adding higher concurrency and some features that speed things up
mkdir -p ~/.config/nix/
echo -e 'max-jobs = auto\nexperimental-features = nix-command flakes' >>~/.config/nix/nix.conf
. $HOME/.nix-profile/etc/profile.d/nix.sh
# install direnv, nix-direnv, and cachix
nix-env -f 'https://github.com/jpetrucciani/nix/archive/main.tar.gz' -iA direnv nix-direnv cachix
echo "source $HOME/.nix-profile/share/nix-direnv/direnvrc" >~/.direnvrc
echo ". $HOME/.nix-profile/etc/profile.d/nix.sh" >>~/.bashrc
echo 'eval "$(direnv hook bash)"' >>~/.bashrc
echo ". $HOME/.nix-profile/etc/profile.d/nix.sh" >>~/.zshrc
echo 'eval "$(direnv hook zsh)"' >>~/.zshrc
} # End of wrapping