use xvfb-run to create headless anki if no running instance is available

This commit is contained in:
andromeda
2026-04-18 10:08:48 +02:00
parent da93183389
commit 219930f3c6
2 changed files with 35 additions and 3 deletions

View File

@@ -20,7 +20,7 @@
toolchain = fenix.packages.x86_64-linux.minimal.toolchain;
in {
devShells.x86_64-linux.default = pkgs.mkShell {
buildInputs = [toolchain];
buildInputs = [toolchain pkgs.xvfb-run];
shellHook = ''
export RUSTUP_TOOLCHAIN=${toolchain}
'';
@@ -30,7 +30,12 @@
cargo = toolchain;
rustc = toolchain;
}).buildPackage {
nativeBuildInputs = [pkgs.makeWrapper];
src = ./.;
postInstall = ''
wrapProgram $out/bin/anki-cli \
--prefix PATH : ${pkgs.xvfb-run}/bin
'';
};
};
}