From 5ea5a2e73a518194fae1c86776c235025decb3d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tristan=20Dani=C3=ABl=20Maat?= Date: Sat, 8 Feb 2020 21:31:49 +0900 Subject: [PATCH] Add Makefile for simpler testing --- .gitignore | 4 ++-- Makefile | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 Makefile 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 $^'