apps/run-workflow-with-vm: remove wrapper and update README

This commit is contained in:
Gabriel Arazas 2024-08-24 17:04:45 +08:00
parent ba46b81e0a
commit 50b8033ef0
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360
2 changed files with 9 additions and 8 deletions

View File

@ -37,3 +37,12 @@ Once you have an folder containing those extra snippets, you can simply include
---- ----
run-workflow-with-vm a-happy-gnome -I extra-config=./extra-config-stuff run-workflow-with-vm a-happy-gnome -I extra-config=./extra-config-stuff
---- ----
Another thing, this script is using https://github.com/nix-community/nixos-generators[nixos-generators] to build the VM which in turn basically uses nixpkgs' integration of it (at `${pkgs.path}/nixos/modules/virtualisation/build-vm.nix`).
You can extend it either by adding NixOS modules configuring the virtual machine or by adding certain arguments to the script.
This won't be an exhaustive list of niceties as it involves a script that may change but here's some things you can do.
* You can pass the `SHARED_DIR` environment variable to add a directory to be shared from the host and the guest.
This is useful for testing out spontaneous changes as if you're booting into the system itself.
* You can pass additional arguments as if you're using `qemu-*` utilities which would be useful for changing graphical drivers and all that jazz.

View File

@ -2,8 +2,6 @@
, lib , lib
, meson , meson
, ninja , ninja
, nix
, makeWrapper
, inputs ? [ ] , inputs ? [ ]
}: }:
@ -16,18 +14,12 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [ nativeBuildInputs = [
meson meson
ninja ninja
makeWrapper
]; ];
preConfigure = '' preConfigure = ''
mesonFlagsArray+=("-Dinputs=[${lib.concatStringsSep "," inputs}]") mesonFlagsArray+=("-Dinputs=[${lib.concatStringsSep "," inputs}]")
''; '';
postInstall = ''
wrapProgram $out/bin/${finalAttrs.pname} \
--prefix PATH ':' '${lib.makeBinPath [ nix ]}'
'';
meta = with lib; { meta = with lib; {
description = "Quickly run workflow modules with a VM."; description = "Quickly run workflow modules with a VM.";
license = licenses.gpl3Plus; license = licenses.gpl3Plus;