Add installers for common programs to bring along
This commit is contained in:
35
installers/install-nix.sh
Executable file
35
installers/install-nix.sh
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Install the Nix package manager as a secondary package manager.
|
||||
# This can sometimes be useful for getting more recent packages.
|
||||
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# Abort installation if Nix is already installed
|
||||
if [ -d /nix ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Download the Nix installer and it's signature from NixOS.org
|
||||
curl -so install-nix https://releases.nixos.org/nix/nix-2.18.1/install
|
||||
|
||||
# Run the installer
|
||||
sh ./install-nix
|
||||
|
||||
# Source the nix profile
|
||||
cat << EOF > ~vagrant/.bashrc
|
||||
# Source nix if it's installed
|
||||
if [ -r ~/.nix-profile/etc/profile.d/nix.sh ]; then
|
||||
. ~/.nix-profile/etc/profile.d/nix.sh
|
||||
fi
|
||||
EOF
|
||||
|
||||
# Remove the installer and signature
|
||||
rm -f ./install-nix
|
||||
|
||||
# Enable flakes and the nix command
|
||||
mkdir -p ~/.config/nix
|
||||
cat <<EOF > ~/.config/nix/nix.conf
|
||||
experimental-features = flakes nix-command
|
||||
EOF
|
||||
Reference in New Issue
Block a user