BIN_DIR :=	${HOME}/.local/bin

.PHONY: install link update-targets

install: $(BIN_DIR)
	cp script/rebuild-nixos $(BIN_DIR)/
	chmod +x $(BIN_DIR)/rebuild-nixos

link: $(BIN_DIR)
	ln -sf $(CURDIR)/script/rebuild-nixos $(BIN_DIR)/

$(BIN_DIR):
	mkdir -p $(BIN_DIR)

update-targets.mk: flake.nix script/gen-update-targets.sh
	script/gen-update-targets.sh > $@

-include update-targets.mk
