diff --git a/Makefile b/Makefile index c5db1aed..97108776 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,6 @@ +USER := hlissner +HOST := kuro + NIXOS_VERSION := 19.09 NIXOS_PREFIX := $(PREFIX)/etc/nixos COMMAND := test @@ -54,6 +57,7 @@ channels: $(NIXOS_PREFIX)/configuration.nix: @sudo nixos-generate-config --root "$(PREFIX)" @echo "import /etc/dotfiles \"$${HOST:-$$(hostname)}\" \"$$USER\"" | sudo tee "$(NIXOS_PREFIX)/configuration.nix" + @[ -f machines/$(HOST).nix ] || echo "WARNING: hosts/$(HOST)/default.nix does not exist" # Convenience aliases diff --git a/README.md b/README.md index c45a7bb5..8776d03b 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,8 @@ ```sh # Assumes your partitions are set up and root is mounted on /mnt -curl https://raw.githubusercontent.com/hlissner/dotfiles/master/deploy | sh +git clone https://github.com/hlissner/dotfiles /etc/dotfiles +USER=hlissner HOST=kuro make -C /etc/dotfiles install ``` Which is equivalent to: diff --git a/deploy b/deploy deleted file mode 100755 index be3e3865..00000000 --- a/deploy +++ /dev/null @@ -1,24 +0,0 @@ -#!/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