Add Makefile for simpler testing

pull/1/head
Tristan Daniël Maat 2020-02-08 21:31:49 +09:00
parent fe11b58a8a
commit 5ea5a2e73a
Signed by: tlater
GPG Key ID: 49670FD774E43268
2 changed files with 13 additions and 2 deletions

4
.gitignore vendored
View File

@ -1,2 +1,2 @@
/etc/nixos/result
/etc/nixos/tlater.net.qcow2
/result
/tlater.net.qcow2

11
Makefile Normal file
View File

@ -0,0 +1,11 @@
result: etc/nixos/configuration.nix
nix-build '<nixpkgs/nixos>' -A vm -k -I nixos-config=$^
tlater.net.qcow2:
nix-shell -p qemu --run 'qemu-img create -f qcow2 $@ 10G'
run: result tlater.net.qcow2
QEMU_OPTS="-m 4096 -nographic" QEMU_NET_OPTS="hostfwd=tcp::2222-:2222,hostfwd=tcp::8000-:80" ./result/bin/run-tlater.net-vm
format: $(wildcard etc/nixos/**/*.nix)
nix-shell -p nixpkgs-fmt --run 'nixpkgs-fmt $^'