helm/deploy

25 lines
565 B
Plaintext
Raw Normal View History

#!/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}
2020-01-17 01:22:50 -08:00
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