diff --git a/apps/run-workflow-with-vm/README.adoc b/apps/run-workflow-with-vm/README.adoc index 91a31bbb..158b4a37 100644 --- a/apps/run-workflow-with-vm/README.adoc +++ b/apps/run-workflow-with-vm/README.adoc @@ -16,7 +16,7 @@ When run, it should build a VM with its script to easily initialize it. == Extra niceties -There's some niceties left with this script including the ability to include your own config by overriding `extra-config` as part of the include path. +There's some niceties left with this script including the ability to include your own set of modules by overriding `extra-config` as part of the include path. It is expected that the extra configuration folder is structured similarly to this NixOS cluster. [source, tree] diff --git a/apps/run-workflow-with-vm/app.sh b/apps/run-workflow-with-vm/app.sh index eca99875..b85b18b3 100644 --- a/apps/run-workflow-with-vm/app.sh +++ b/apps/run-workflow-with-vm/app.sh @@ -3,6 +3,11 @@ workflow=$1 shift 1 +# Just mind the ordering of the search paths here, the extra `extra-config` is +# just the fallback value. As of Nix v2.18, there is a first-come first-serve +# precedence so if the user sets the `extra-config` Nix path, it should +# override the default. + # shellcheck disable=SC2068 nix-build -A config.system.build.vm -k \ --argstr workflow "$workflow" \ diff --git a/apps/run-workflow-with-vm/default.nix b/apps/run-workflow-with-vm/default.nix index 02bfe86c..4f1036b3 100644 --- a/apps/run-workflow-with-vm/default.nix +++ b/apps/run-workflow-with-vm/default.nix @@ -2,13 +2,14 @@ , lib , meson , ninja +, nix , makeWrapper , inputs ? [ ] }: -stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { pname = "run-workflow-with-vm"; - version = "2024-03-15"; + version = "2024-05-10"; src = ./.; @@ -22,9 +23,16 @@ stdenv.mkDerivation { mesonFlagsArray+=("-Dinputs=[${lib.concatStringsSep "," inputs}]") ''; + postInstall = '' + wrapProgram $out/bin/${finalAttrs.pname} \ + --prefix PATH ':' '${lib.makeBinPath [ nix ]}' + ''; + meta = with lib; { description = "Quickly run workflow modules with a VM."; license = licenses.gpl3Plus; platforms = platforms.linux; + mainProgram = finalAttrs.pname; + maintainers = with maintainers; [ foo-dogsquared ]; }; -} +}) diff --git a/apps/run-workflow-with-vm/meson.build b/apps/run-workflow-with-vm/meson.build index 2d3c6130..b8e48cd9 100644 --- a/apps/run-workflow-with-vm/meson.build +++ b/apps/run-workflow-with-vm/meson.build @@ -1,5 +1,5 @@ project('run-workflow-with-vm', - version: '2024-03-15', + version: '2024-05-10', license: 'GPL-3.0-or-later', meson_version: '>=0.54.0', ) @@ -20,7 +20,7 @@ bindata.set('inputsArgs', inputsArgs) bindata.set('projectname', meson.project_name()) configure_file( input: 'app.sh', - output: 'run-workflow-with-vm', + output: meson.project_name(), configuration: bindata, install_dir: get_option('bindir'), install_mode: 'rwxr-xr-x',