feat: show why units failed, with their last journal lines

Failed jobs keep their kind: units that broke or timed out get a failure
panel entry with the reason systemd reports (exit status, signal, timeout,
start limit, status text) and their last journal lines read through
libsystemd. Units that failed only through a dependency are dimmed and left
out of the panel, and units that crash after starting count as failed.

Restructure the repository around this:
- move the library and binary into bootvine/ and the scripted demos into
  their own unpublished scripted-demos crate, with their VHS tapes
- move the crane builds and NixOS module into nix/
- group each sample VM with its check under vm-tests/, adding text-console,
  scripted-initrd, encrypted-volume and failures machines and a vm-failures
  check
- add docs/guide.md walking through the screen with every recording, keep
  one recording in the README, and re-render all recordings
This commit is contained in:
Willem Vanhulle committed 2026-10-30 14:59:10 +01:00
1 parent f2544a964a
commit 7e95cbd8e9
96 files changed
+2027 -462

No files matched your search

+81
View File
@@ -0,0 +1,81 @@
{
lib,
pkgs,
craneLib,
}:
let
bootvineCrate = craneLib.crateNameFromCargoToml { cargoToml = ../bootvine/Cargo.toml; };
commonArgs = {
inherit (bootvineCrate) pname version;
src = lib.fileset.toSource {
root = ../.;
fileset = lib.fileset.unions [
(craneLib.fileset.commonCargoSources ../.)
../bootvine/system-files
../.rustfmt.toml
];
};
strictDeps = true;
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [
pkgs.dbus
pkgs.systemd
];
};
cargoArtifacts = craneLib.buildDepsOnly (commonArgs // { pname = "bootvine-workspace"; });
buildWorkspaceMember =
args: craneLib.buildPackage (commonArgs // { inherit cargoArtifacts; } // args);
in
{
rustfmt-formatting = craneLib.cargoFmt {
inherit (commonArgs) src pname version;
cargoExtraArgs = "--all";
};
clippy-lints = craneLib.cargoClippy (
commonArgs
// {
inherit cargoArtifacts;
cargoClippyExtraArgs = "--workspace --all-targets -- --deny warnings";
}
);
bootvine = buildWorkspaceMember {
cargoExtraArgs = "-p bootvine";
postInstall = ''
for unit in bootvine.service bootvine-shutdown.service; do
install -Dm644 bootvine/system-files/systemd/$unit $out/lib/systemd/system/$unit
substituteInPlace $out/lib/systemd/system/$unit \
--replace-fail /usr/bin/bootvine $out/bin/bootvine
done
install -Dm755 bootvine/system-files/dracut/90bootvine/module-setup.sh \
$out/lib/dracut/modules.d/90bootvine/module-setup.sh
install -Dm644 bootvine/system-files/mkinitcpio/install/sd-bootvine \
$out/lib/initcpio/install/sd-bootvine
'';
meta = {
mainProgram = "bootvine";
platforms = lib.platforms.linux;
license = lib.getLicenseFromSpdxId (lib.importTOML ../bootvine/Cargo.toml).package.license;
};
};
scripted-demos = buildWorkspaceMember {
inherit (craneLib.crateNameFromCargoToml { cargoToml = ../scripted-demos/Cargo.toml; })
pname
version
;
cargoExtraArgs = "-p scripted-demos";
doCheck = false;
};
repo-tasks = buildWorkspaceMember {
inherit (craneLib.crateNameFromCargoToml { cargoToml = ../xtask/Cargo.toml; }) pname version;
cargoExtraArgs = "-p xtask";
doCheck = false;
meta.mainProgram = "xtask";
};
}
+71
View File
@@ -0,0 +1,71 @@
{ self }:
{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.bootvine;
settingsFormat = pkgs.formats.toml { };
uncheckedConfigFile = settingsFormat.generate "bootvine-unchecked.toml" cfg.settings;
canRunPackage = pkgs.stdenv.buildPlatform.canExecute pkgs.stdenv.hostPlatform;
configFile = pkgs.runCommand "bootvine.toml" { } ''
${lib.optionalString canRunPackage "${lib.getExe cfg.package} check ${uncheckedConfigFile}"}
cp ${uncheckedConfigFile} $out
'';
hasSettings = cfg.settings != { };
in
{
options.services.bootvine = {
enable = lib.mkEnableOption ''
a live dependency tree of systemd jobs on the boot console. With a
systemd initrd it starts there and survives the switch to the real root;
otherwise it starts in stage 2. It hands the console back once the
display manager switches to its terminal or the default target is
reached, and comes back
for shutdown until systemd hands over to systemd-shutdown
'';
package = lib.mkOption {
type = lib.types.package;
default = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
defaultText = lib.literalExpression "bootvine.packages.\${system}.default";
description = "The bootvine package, which ships the systemd unit.";
};
settings = lib.mkOption {
inherit (settingsFormat) type;
default = { };
example = {
colors.tree.running-marker = "light-yellow";
timing.keep-final-frame-for = "500ms";
};
description = ''
Written to {file}`/etc/bootvine.toml`, in the real root and the
initrd. `bootvine defaults --format nix` prints every key with its
default; the build fails if `bootvine check` rejects the result.
'';
};
};
config = lib.mkIf cfg.enable {
environment = {
systemPackages = [ cfg.package ];
etc."bootvine.toml" = lib.mkIf hasSettings { source = configFile; };
};
systemd = {
packages = [ cfg.package ];
services.bootvine.wantedBy = [ "sysinit.target" ];
services.bootvine-shutdown.wantedBy = [ "shutdown.target" ];
};
boot.initrd.systemd = {
packages = [ cfg.package ];
storePaths = [ (lib.getExe cfg.package) ];
services.bootvine.wantedBy = [ "sysinit.target" ];
contents."/etc/bootvine.toml" = lib.mkIf hasSettings { source = configFile; };
};
};
}