nixos-config/apps/run-workflow-with-vm
2025-01-05 19:01:11 +08:00
..
modules apps/run-workflow-with-vm: add extra-config as part of include path 2024-03-03 16:40:31 +08:00
app.sh apps/run-workflow-with-vm: update to 2024-05-10 2024-05-18 16:41:21 +08:00
configuration.nix apps/run-workflow-with-vm: set to allow unfree in nixpkgs config 2025-01-05 19:01:11 +08:00
default.nix apps/run-workflow-with-vm: remove wrapper and update README 2024-08-24 17:04:45 +08:00
LICENSE apps/run-workflow-with-vm: add README and LICENSE file 2024-03-03 16:47:25 +08:00
meson_options.txt flake.nix: add run-workflow-with-vm app 2024-01-05 20:20:37 +08:00
meson.build apps/run-workflow-with-vm: update to 2024-05-17 2024-05-18 16:41:22 +08:00
README.adoc apps/run-workflow-with-vm: remove wrapper and update README 2024-08-24 17:04:45 +08:00

Table of Contents

An internal script for the sole purpose of building NixOS VMs with the given NixOS workflows. It is mainly used to developing them workflows (READ: rices). As a (VERY NEAT) side effect, if we exported this app, we can basically let other people test and even reproduce our workflows with this script. It only expects the name of the workflow as the first argument with the rest to be passed as part of nix-build (which is the backbone of the script).

run-workflow-with-vm a-happy-gnome

When run, it should build a VM with its script to easily initialize it.

Extra niceties

Theres 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.

./extra-config-stuff
└── modules
    ├── home-manager
    │   └── default.nix
    ├── nixvim
    │   └── default.nix
    └── nixos
        └── default.nix

Once you have an folder containing those extra snippets, you can simply include them like so.

run-workflow-with-vm a-happy-gnome -I extra-config=./extra-config-stuff

Another thing, this script is using 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 wont be an exhaustive list of niceties as it involves a script that may change but heres 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 youre booting into the system itself.

  • You can pass additional arguments as if youre using qemu-* utilities which would be useful for changing graphical drivers and all that jazz.