-
Notifications
You must be signed in to change notification settings - Fork 241
/
bootstrap.sh
executable file
·42 lines (35 loc) · 1.16 KB
/
bootstrap.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
echo "Bootstrapping the homies!"
# We need Nix to download all the applications we need
function install_nix() {
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install
}
# Configure Nix so we can use experimental features
function configure_nix() {
echo "Configuring nix"
NIX_CONFIG_PATH=$HOME/.config/nix
if [ ! -d "$NIX_CONFIG_PATH" ]; then
echo "$NIX_CONFIG_PATH doesn't exist, creating it."
mkdir -p $NIX_CONFIG_PATH
fi
touch $NIX_CONFIG_PATH/nix.conf
CONFIG_STRING="experimental-features = nix-command flakes"
if grep -R "$CONFIG_STRING" $NIX_CONFIG_PATH/nix.conf;then
echo "Experimental features already enabled"
else
echo "Enabling experimental features"
echo "$CONFIG_STRING" >> $NIX_CONFIG_PATH/nix.conf
fi
}
function install_dependencies() {
echo "Installing dependencies"
nix profile install nixpkgs#just
nix profile install nixpkgs#ripgrep
}
function done_bootstrapping() {
echo "Completed bootstrap!"
echo "Now you can run `just` to install the rest"
}
install_nix
configure_nix
install_dependencies