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
43 lines
1.2 KiB
Nix
43 lines
1.2 KiB
Nix
{ lib, pkgs, ... }:
|
|
let
|
|
sampleUnits = import ./sample-units.nix;
|
|
|
|
sampleService = spec: {
|
|
inherit (spec) description;
|
|
after = map (dependency: "${dependency}.service") (spec.after or [ ]);
|
|
wantedBy = [ "multi-user.target" ];
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
ExecStart = [
|
|
"${pkgs.coreutils}/bin/sleep ${spec.seconds}"
|
|
]
|
|
++ lib.optional (spec.fails or false) "${pkgs.coreutils}/bin/false";
|
|
}
|
|
// lib.optionalAttrs (spec ? stopSeconds) {
|
|
RemainAfterExit = true;
|
|
ExecStop = "${pkgs.coreutils}/bin/sleep ${spec.stopSeconds}";
|
|
};
|
|
};
|
|
in
|
|
{
|
|
boot.initrd.systemd.services.initrd-hardware-probe = {
|
|
description = "Slow hardware probe";
|
|
wantedBy = [ "initrd.target" ];
|
|
before = [ "initrd.target" ];
|
|
unitConfig.DefaultDependencies = false;
|
|
serviceConfig = {
|
|
Type = "oneshot";
|
|
ExecStart = "/bin/sleep ${sampleUnits.initrdProbeSeconds}";
|
|
};
|
|
};
|
|
|
|
systemd.services = lib.mapAttrs (_: sampleService) sampleUnits.services // {
|
|
greetd.after = [ "multi-user.target" ];
|
|
};
|
|
|
|
services.greetd = {
|
|
enable = true;
|
|
settings.default_session.command = "${pkgs.greetd}/bin/agreety --cmd ${pkgs.bashInteractive}/bin/bash";
|
|
};
|
|
}
|