Get rid of deploy script & update readme

Simplify simplify simplify!
This commit is contained in:
Henrik Lissner 2020-04-12 21:12:01 -04:00
parent 80c32a859c
commit 6724e66412
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 6 additions and 25 deletions

View file

@ -1,3 +1,6 @@
USER := hlissner
HOST := kuro
NIXOS_VERSION := 19.09 NIXOS_VERSION := 19.09
NIXOS_PREFIX := $(PREFIX)/etc/nixos NIXOS_PREFIX := $(PREFIX)/etc/nixos
COMMAND := test COMMAND := test
@ -54,6 +57,7 @@ channels:
$(NIXOS_PREFIX)/configuration.nix: $(NIXOS_PREFIX)/configuration.nix:
@sudo nixos-generate-config --root "$(PREFIX)" @sudo nixos-generate-config --root "$(PREFIX)"
@echo "import /etc/dotfiles \"$${HOST:-$$(hostname)}\" \"$$USER\"" | sudo tee "$(NIXOS_PREFIX)/configuration.nix" @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 # Convenience aliases

View file

@ -25,7 +25,8 @@
```sh ```sh
# Assumes your partitions are set up and root is mounted on /mnt # 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: Which is equivalent to:

24
deploy
View file

@ -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