Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit17468dc5b5df7284559ea356f1f4f5a1744ddbf0 (patch)
Author
 Syndamia <kamen@syndamia.com>
2025-06-29 17:00:00 +0300
Committer
 Syndamia <kamen@syndamia.com>
2025-06-29 17:00:00 +0300
Files3fe349fcbc26b0dc2cc04f3fc81785df303292f2
nix-17468dc5b5df7284559ea356f1f4f5a1744ddbf0.tar
nix-17468dc5b5df7284559ea356f1f4f5a1744ddbf0.tar.gz
nix-17468dc5b5df7284559ea356f1f4f5a1744ddbf0.zip
Parenta0c3561302773920435cc5fd2d2f4ccf7202fa95 (diff)
feat: Add Justfile
1 files changed, 27 insertions, 0 deletions
-rw-r--r--Justfile27
diff --git a/Justfile b/Justfile
new file mode 100644
index 0000000..d457f20
--- /dev/null
+++ b/Justfile
@@ -0,0 +1,27 @@
+HOSTNAME := env_var_or_default("HOSTNAME", "")
+
+# Build system and switch it
+switch:
+ sudo nixos-rebuild switch
+
+# Build the ISO image
+[no-cd]
+build-iso:
+ nix build .#nixosConfigurations.iso.config.system.build.isoImage
+ nix eval --raw .#nixosConfigurations.iso.config.system.build.isoImage
+ @echo
+
+# Build a virtual machine
+[no-cd]
+build-vm hostname=HOSTNAME:
+ nixos-rebuild build-vm --flake .#{{hostname}}
+
+# Launch the virtual machine. Expects result to be in /etc/nixos.
+[no-cd]
+start-vm hostname=HOSTNAME:
+ rm {{hostname}}.qcow2 || true
+ ./result/bin/run-{{hostname}}-vm
+
+# Build and start virtual machine
+[no-cd]
+run-vm hostname=HOSTNAME: (build-vm hostname) (start-vm hostname)