From 808b9a7fe97a927b96c440ed4616502e0bea68fc Mon Sep 17 00:00:00 2001 From: Andrew Bryant Date: Mon, 25 May 2026 19:02:53 -0400 Subject: [PATCH] Replaced Makefile with justfile --- Makefile | 45 --------------------------------------------- justfile | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 45 deletions(-) delete mode 100644 Makefile create mode 100644 justfile diff --git a/Makefile b/Makefile deleted file mode 100644 index 6b5e760..0000000 --- a/Makefile +++ /dev/null @@ -1,45 +0,0 @@ -#### -# Target definitions -#### - -# Disable echoing of target recipe commands -# Comment this for debugging -.SILENT: - -# Run target recipes in one shell invocation -.ONESHELL: - -# Since all targets are phony, all targets should be listed here -# One target per line -.PHONY: boot-vm \ - build-vm \ - clean \ - format-nix-files \ - help - -# Show the help text -help: - egrep -h '\s##\s' $(MAKEFILE_LIST) \ - | sort \ - | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' - - -format-nix-files: ## Format nix files using the nixpkgs-fmt tool - find . -name "*.nix" -exec nixpkgs-fmt {} \; - -clean: ## Clean build artifacts and shutdown running virtual machines - rm result > /dev/null 2>&1 - rm nixos.qcow2 > /dev/null 2>&1 - pkill qemu - exit 0 - -build-vm: clean ## Build virtual machine for testing - nix build ".#nixosConfigurations.test.config.system.build.vm" - -boot-vm: ## Run virtual machine in current terminal - QEMU_KERNEL_PARAMS=console=ttyS0 \ - QEMU_NET_OPTS=hostfwd=tcp::8080-:80 \ - QEMU_OPTS=-nographic \ - ./result/bin/run-nixos-vm - reset - diff --git a/justfile b/justfile new file mode 100644 index 0000000..4a777e6 --- /dev/null +++ b/justfile @@ -0,0 +1,33 @@ +set quiet := true + +# Passed to QEMU in boot-vm +export QEMU_KERNEL_PARAMS := "console=ttyS0" +export QEMU_NET_OPTS := "hostfwd=tcp::8080-:80" +export QEMU_OPTS := "-nographic" + +[private] +_default: + just --list + +[doc('Clean build artifacts and shutdown running virtual machines')] +[group('maintenance')] +clean: + #!/usr/bin/env bash + rm result > /dev/null 2>&1 + rm nixos.qcow2 > /dev/null 2>&1 + pkill qemu + exit 0 + +[doc('Build virtual machine for testing')] +[group('main')] +build-vm: clean + nom build ".#nixosConfigurations.test.config.system.build.vm" + +[doc('Run virtual machine in current terminal')] +[group('main')] +boot-vm: + #!/usr/bin/env bash + [ -x result/bin/run-nixos-vm ] && \ + ./result/bin/run-nixos-vm + reset +