diff --git a/.gitignore b/.gitignore index 5fe7211..fa9bea6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/etc/nixos/result -/etc/nixos/tlater.net.qcow2 +/result +/tlater.net.qcow2 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e449618 --- /dev/null +++ b/Makefile @@ -0,0 +1,11 @@ +result: etc/nixos/configuration.nix + nix-build '' -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 $^'