helm/deploy
2020-04-08 03:52:07 -04:00

25 lines
565 B
Plaintext
Executable file

#!/usr/bin/env nix-shell
#! nix-shell -i bash -p git gnumake
set -e # bail if an error occurs
if [ $EUID -nq 0 ]; then
>&2 echo "Must be run as root"
exit 1
fi
USER=${USER:-hlissner}
HOST=${1:-${HOST:-$(hostname)}}
DOTFILES="/home/$USER/.dotfiles"
if [ ! -d /etc/dotfiles ]; then
git clone https://github.com/hlissner/dotfiles "$DOTFILES"
chown -R $USER:users "$DOTFILES"
fi
ln -sf "$DOTFILES" /etc/dotfiles
if [ ! -f "$DOTFILES/machines/$HOST.nix" ]; then
>&2 echo "No configuration exists for host '$HOST'"
exit 1
fi
make -C "$DOTFILES" install