all: init

include .lib/nixops/Makefile.make

.PHONY: base/unbound/named.root
base/unbound/named.root:
	mkdir -p $(@D)
	curl >$@ -L https://www.internic.net/domain/named.root

send-pass:
	rsync -ai --delete ../sec/pass julm@sourcephile.fr:work/sourcephile/sec/
recv-pass:
	rsync -ai --delete julm@sourcephile.fr:work/sourcephile/sec/pass  ../sec/
recv-gnupg:
	rsync -ai --delete julm@sourcephile.fr:work/sourcephile/sec/gnupg  ../sec/
recv-ssh:
	rsync -ai --delete julm@sourcephile.fr:work/sourcephile/sec/ssh  ../sec/

tunnel-rspamd:
	ssh -nNTL 11334:localhost:11334 root@sourcephile.fr

#
## init
###
.PHONY: build
build:
	nix $(NIX_FLAGS) build -f build \
	 --out-link result \
	 --show-trace $(NIX_BUILD_FLAGS)
	tree result/

init: build
	result/bin/init