From 4c55a89585c6d3628cbcf04dee2034416bd90b78 Mon Sep 17 00:00:00 2001 From: dusk Date: Sat, 12 Jul 2025 20:34:44 +0300 Subject: [PATCH] flake.nix,docs: add a vm app output for running the vm more conveniently, update hacking doc --- docs/hacking.md | 9 +++++---- flake.nix | 6 ++++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/docs/hacking.md b/docs/hacking.md index dd73293..d2dcb39 100644 --- a/docs/hacking.md +++ b/docs/hacking.md @@ -47,14 +47,15 @@ You can now start a lightweight NixOS VM using `nixos-shell` like so: ```bash -QEMU_NET_OPTS="hostfwd=tcp::6000-:6000,hostfwd=tcp::2222-:22" nixos-shell --flake .#knotVM +nix run .#vm +# or nixos-shell --flake .#vm # hit Ctrl-a + c + q to exit the VM ``` -This starts a knot on port 6000 with `ssh` exposed on port -2222. You can push repositories to this VM with this ssh -config block on your main machine: +This starts a knot on port 6000, a spindle on port 6555 +with `ssh` exposed on port 2222. You can push repositories +to this VM with this ssh config block on your main machine: ```bash Host nixos-shell diff --git a/flake.nix b/flake.nix index c57e487..d33a269 100644 --- a/flake.nix +++ b/flake.nix @@ -173,6 +173,12 @@ type = "app"; program = ''${tailwind-watcher}/bin/run''; }; + vm = { + type = "app"; + program = toString (pkgs.writeShellScript "vm" '' + ${pkgs.nixos-shell}/bin/nixos-shell --flake .#vm + ''); + }; }); nixosModules.appview = import ./nix/modules/appview.nix {inherit self;}; -- 2.43.0