2020-01-13 16:56:39 -08:00
|
|
|
#!/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)}}
|
2020-01-13 16:56:39 -08:00
|
|
|
|
|
|
|
DOTFILES="/home/$USER/.dotfiles"
|
|
|
|
if [ ! -d /etc/dotfiles ]; then
|
2020-04-08 00:52:07 -07:00
|
|
|
git clone https://github.com/hlissner/dotfiles "$DOTFILES"
|
2020-01-13 16:56:39 -08:00
|
|
|
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
|