Add asciinema support
This commit is contained in:
parent
981b8ad067
commit
866fe408e4
9 changed files with 2930 additions and 12 deletions
22
content/posts/nix-evaluation-blocking/a.nix
Normal file
22
content/posts/nix-evaluation-blocking/a.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
let
|
||||||
|
pkgs = import <nixpkgs> { };
|
||||||
|
wait = n: builtins.readFile (pkgs.runCommand "delay" { } ''
|
||||||
|
sleep ${toString n}
|
||||||
|
|
||||||
|
echo $((${toString n} * 5)) > $out
|
||||||
|
'');
|
||||||
|
|
||||||
|
in
|
||||||
|
pkgs.stdenv.mkDerivation {
|
||||||
|
name = "blah";
|
||||||
|
dontUnpack = true;
|
||||||
|
doInstall = false;
|
||||||
|
dontConfigure = true;
|
||||||
|
buildPhase = ''
|
||||||
|
echo ${wait 1}
|
||||||
|
echo ${wait 2}
|
||||||
|
echo ${wait 3}
|
||||||
|
touch $out
|
||||||
|
'';
|
||||||
|
doBuild = true;
|
||||||
|
}
|
||||||
182
content/posts/nix-evaluation-blocking/build-oops.cast
Normal file
182
content/posts/nix-evaluation-blocking/build-oops.cast
Normal file
|
|
@ -0,0 +1,182 @@
|
||||||
|
{"version": 2, "width": 100, "height": 15, "timestamp": 1680475860, "env": {"SHELL": "/nix/store/k4j76vg58c6j90s8l46kx3843vysx732-bash-interactive-5.2-p15/bin/bash", "TERM": "xterm-256color"}}
|
||||||
|
[0.007032, "o", "\u001b[?2004h$ "]
|
||||||
|
[0.314298, "o", "n"]
|
||||||
|
[0.346135, "o", "i"]
|
||||||
|
[0.394162, "o", "x"]
|
||||||
|
[0.482229, "o", " "]
|
||||||
|
[0.618363, "o", "b"]
|
||||||
|
[0.682158, "o", "u"]
|
||||||
|
[0.706821, "o", "i"]
|
||||||
|
[0.770157, "o", "l"]
|
||||||
|
[0.790173, "o", "d"]
|
||||||
|
[0.882109, "o", " "]
|
||||||
|
[1.106166, "o", "-"]
|
||||||
|
[1.794143, "o", "L"]
|
||||||
|
[1.858116, "o", " "]
|
||||||
|
[2.074151, "o", "-"]
|
||||||
|
[2.146093, "o", "f"]
|
||||||
|
[2.234079, "o", " "]
|
||||||
|
[2.538128, "o", "a"]
|
||||||
|
[2.602026, "o", "."]
|
||||||
|
[2.818097, "o", "n"]
|
||||||
|
[2.842013, "o", "i"]
|
||||||
|
[2.906005, "o", "x"]
|
||||||
|
[3.066068, "o", "\r\n\u001b[?2004l\r"]
|
||||||
|
[3.082772, "o", "\r\u001b[0m\u001b[K"]
|
||||||
|
[3.132889, "o", "\r\u001b[0m\u001b[K"]
|
||||||
|
[3.18297, "o", "\r\u001b[0m\u001b[K"]
|
||||||
|
[3.233054, "o", "\r\u001b[0m\u001b[K"]
|
||||||
|
[3.283177, "o", "\r[\u001b[32;1m0\u001b[0m/1 built] querying \u001b[1mdelay\u001b[0m on https://cache.nixos.org\u001b[0m\u001b[K"]
|
||||||
|
[3.333249, "o", "\r[\u001b[32;1m0\u001b[0m/1 built] querying \u001b[1mdelay\u001b[0m on https://cache.nixos.org\u001b[0m\u001b[K"]
|
||||||
|
[3.38335, "o", "\r[\u001b[32;1m0\u001b[0m/1 built] querying \u001b[1mdelay\u001b[0m on https://cache.nixos.org\u001b[0m\u001b[K"]
|
||||||
|
[3.433454, "o", "\r[\u001b[32;1m0\u001b[0m/1 built] querying \u001b[1mdelay\u001b[0m on https://cache.nixos.org\u001b[0m\u001b[K"]
|
||||||
|
[3.483562, "o", "\r[\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] \u001b[0m\u001b[K"]
|
||||||
|
[3.53364, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[3.583736, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[3.633831, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[3.683918, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[3.734008, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[3.784101, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[3.834198, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[3.884267, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[3.934354, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[3.984442, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.034536, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.08464, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.134723, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.184818, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.23491, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.285004, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.335095, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.38519, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.435289, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.485386, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m0\u001b[0m/1 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.535475, "o", "\r[\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] querying \u001b[1mdelay\u001b[0m on https://cache.nixos.org\u001b[0m\u001b[K"]
|
||||||
|
[4.585566, "o", "\r[\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] querying \u001b[1mdelay\u001b[0m on https://cache.nixos.org\u001b[0m\u001b[K"]
|
||||||
|
[4.635663, "o", "\r[\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] querying \u001b[1mdelay\u001b[0m on https://cache.nixos.org\u001b[0m\u001b[K"]
|
||||||
|
[4.685777, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.735842, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.785972, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.836088, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.886214, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.936332, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[4.986432, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.036525, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.086625, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.136719, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.186814, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.236908, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.287004, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.337072, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.387182, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.437274, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.487371, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.537467, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.587558, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.637658, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.687748, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.737847, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.787944, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.838028, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.888126, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.938219, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[5.988312, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.038405, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.088499, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.138589, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.188679, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.238774, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.288866, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.338961, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.38906, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.439213, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.489343, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.539461, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.58959, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.639697, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.689801, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m1\u001b[0m/2 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.73984, "o", "\r[\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] querying \u001b[1mdelay\u001b[0m on https://cache.nixos.org\u001b[0m\u001b[K"]
|
||||||
|
[6.789961, "o", "\r[\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] querying \u001b[1mdelay\u001b[0m on https://cache.nixos.org\u001b[0m\u001b[K"]
|
||||||
|
[6.840046, "o", "\r[\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] \u001b[0m\u001b[K"]
|
||||||
|
[6.890106, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.940195, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[6.990292, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.040376, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.090465, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.140564, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.190642, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.240732, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.290823, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.340932, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.391058, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.441175, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.491305, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.54137, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.591473, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.641536, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.691627, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.741762, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.79182, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.84189, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.891987, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.942065, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[7.992151, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.042235, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.092366, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.14247, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.192555, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.242642, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.292734, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.342821, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.392923, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.443013, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.493115, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.543205, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.593302, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.643395, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.693484, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.74357, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.793693, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.843754, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.893853, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.943945, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[8.994038, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.044121, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.09423, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.144326, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.194413, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.244484, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.29459, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.344686, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.394777, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.444909, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.495009, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.545113, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.595202, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.645305, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.695422, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.745501, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.795613, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.845725, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m2\u001b[0m/3 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mdelay\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[9.895792, "o", "\r[\u001b[32;1m3\u001b[0m built, \u001b[32;1m0.0\u001b[0m MiB DL] \u001b[0m\u001b[K"]
|
||||||
|
[9.949954, "o", "\r[\u001b[32;1m3\u001b[0m built, \u001b[32;1m0.0\u001b[0m MiB DL] querying \u001b[1mblah\u001b[0m on https://cache.nixos.org\u001b[0m\u001b[K"]
|
||||||
|
[10.000028, "o", "\r[\u001b[32;1m3\u001b[0m built, \u001b[32;1m0.0\u001b[0m MiB DL] querying \u001b[1mblah\u001b[0m on https://cache.nixos.org\u001b[0m\u001b[K"]
|
||||||
|
[10.050112, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m3\u001b[0m/4 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mblah\u001b[0m\u001b[0m\u001b[K"]
|
||||||
|
[10.065662, "o", "\r\u001b[K\u001b[2mblah> \u001b[0mpatching sources\u001b[0m\r\n"]
|
||||||
|
[10.065722, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m3\u001b[0m/4 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mblah\u001b[0m (patchPhase)\u001b[0m\u001b[K"]
|
||||||
|
[10.068482, "o", "\r\u001b[K\u001b[2mblah> \u001b[0mbuilding\u001b[0m\r\n"]
|
||||||
|
[10.06852, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m3\u001b[0m/4 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mblah\u001b[0m (buildPhase)\u001b[0m\u001b[K"]
|
||||||
|
[10.069812, "o", "\r\u001b[K\u001b[2mblah> \u001b[0m5\u001b[0m\r\n\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m3\u001b[0m/4 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mblah\u001b[0m (buildPhase)\u001b[0m\u001b[K\r\u001b[K\u001b[2mblah> \u001b[0m10\u001b[0m\r\n"]
|
||||||
|
[10.069832, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m3\u001b[0m/4 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mblah\u001b[0m (buildPhase)\u001b[0m\u001b[K\r\u001b[K\u001b[2mblah> \u001b[0m15\u001b[0m\r\n\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m3\u001b[0m/4 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mblah\u001b[0m (buildPhase)\u001b[0m\u001b[K"]
|
||||||
|
[10.072393, "o", "\r\u001b[K\u001b[2mblah> \u001b[0minstalling\u001b[0m\r\n"]
|
||||||
|
[10.072428, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m3\u001b[0m/4 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mblah\u001b[0m (installPhase)\u001b[0m\u001b[K"]
|
||||||
|
[10.073934, "o", "\r\u001b[K\u001b[2mblah> \u001b[0mno Makefile or custom installPhase, doing nothing\u001b[0m\r\n\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m3\u001b[0m/4 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mblah\u001b[0m (installPhase)\u001b[0m\u001b[K"]
|
||||||
|
[10.075025, "o", "\r\u001b[K\u001b[2mblah> \u001b[0mpost-installation fixup\u001b[0m\r\n\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m3\u001b[0m/4 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mblah\u001b[0m (fixupPhase)\u001b[0m\u001b[K"]
|
||||||
|
[10.080837, "o", "\r\u001b[K\u001b[2mblah> \u001b[0mshrinking RPATHs of ELF executables and libraries in /nix/store/4g3dr2qinylfdz0m0afnsfkh74kmcfdm-blah\u001b[0m\r\n"]
|
||||||
|
[10.080849, "o", "\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m3\u001b[0m/4 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mblah\u001b[0m (fixupPhase)\u001b[0m\u001b[K"]
|
||||||
|
[10.081909, "o", "\r\u001b[K\u001b[2mblah> \u001b[0mchecking for references to /build/ in /nix/store/4g3dr2qinylfdz0m0afnsfkh74kmcfdm-blah...\u001b[0m\r\n\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m3\u001b[0m/4 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mblah\u001b[0m (fixupPhase)\u001b[0m\u001b[K"]
|
||||||
|
[10.083149, "o", "\r\u001b[K\u001b[2mblah> \u001b[0mpatching script interpreter paths in /nix/store/4g3dr2qinylfdz0m0afnsfkh74kmcfdm-blah\u001b[0m\r\n\r[\u001b[34;1m1\u001b[0m/\u001b[32;1m3\u001b[0m/4 built, \u001b[32;1m0.0\u001b[0m MiB DL] building \u001b[1mblah\u001b[0m (fixupPhase)\u001b[0m\u001b[K"]
|
||||||
|
[10.095936, "o", "\r\u001b[K"]
|
||||||
|
[10.098692, "o", "\u001b[?2004h$ "]
|
||||||
|
[13.114171, "o", "\u001b[?2004l\r\r\n"]
|
||||||
|
[13.11422, "o", "exit\r\n"]
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
+++
|
+++
|
||||||
date = "2023-03-30"
|
date = "2023-04-02"
|
||||||
draft = true
|
draft = false
|
||||||
path = "/blog/nix-evaluation-blocking"
|
path = "/blog/nix-evaluation-blocking"
|
||||||
tags = ["haskell", "nix"]
|
tags = ["haskell", "nix"]
|
||||||
title = "Stopping evaluation from blocking in Nix"
|
title = "Stopping evaluation from blocking in Nix"
|
||||||
|
|
||||||
|
[extra]
|
||||||
|
use_asciinema = true
|
||||||
+++
|
+++
|
||||||
|
|
||||||
Nix has a feature called "import from derivation", which is sometimes called
|
Nix has a feature called "import from derivation", which is sometimes called
|
||||||
|
|
@ -93,6 +96,31 @@ nixpkgs:
|
||||||
* `builtins.fetchurl`
|
* `builtins.fetchurl`
|
||||||
* etc
|
* etc
|
||||||
|
|
||||||
|
Here is what it looks like for a build to block on import-from-derivation on
|
||||||
|
the new-style `nix build` command. The sign that it's doing an IFD is that it's
|
||||||
|
building one thing at a time, it may or may not be punctuated by an occasional
|
||||||
|
empty line (while running evaluation), and the last number in "1/2/3 built"
|
||||||
|
keeps going up.
|
||||||
|
|
||||||
|
{{ asciinema(path="build-oops.cast", colocated=true, preload=true) }}
|
||||||
|
|
||||||
|
This is a much less clear sign than the old `nix-build` CLI,
|
||||||
|
which would print "building '/nix/store/...'" for several lines before the
|
||||||
|
typical "this derivation will be built" obtained when evaluation is done:
|
||||||
|
|
||||||
|
```
|
||||||
|
building '/nix/store/c11sidylvwss1xn2b159imk2li6flphq-delay.drv'...
|
||||||
|
building '/nix/store/2g0rglrimm2p4j4gj7j3n4mlgqfghqic-delay.drv'...
|
||||||
|
building '/nix/store/ywppgzc698pb979rwmavnmn9wf3hzvcb-delay.drv'...
|
||||||
|
this derivation will be built:
|
||||||
|
/nix/store/n47ad95nmq16442vyl2d8w2knpp3ngws-blah.drv
|
||||||
|
```
|
||||||
|
|
||||||
|
Here's the Nix code I used to create these demos. It's using IFD because of the
|
||||||
|
`builtins.readFile` on a derivation.
|
||||||
|
|
||||||
|
{{ codefile(path="a.nix", colocated=true, code_lang='nix') }}
|
||||||
|
|
||||||
#### Builtin fetchers
|
#### Builtin fetchers
|
||||||
|
|
||||||
Use of builtin fetchers is a surprisingly common problem of blocking in
|
Use of builtin fetchers is a surprisingly common problem of blocking in
|
||||||
2637
static/css/asciinema-player.css
Normal file
2637
static/css/asciinema-player.css
Normal file
File diff suppressed because it is too large
Load diff
1
static/js/asciinema-player.min.js
vendored
Normal file
1
static/js/asciinema-player.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
30
templates/macros/asciinema.html
Normal file
30
templates/macros/asciinema.html
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
{%- import "macros/colocated_asset.html" as colocated_asset -%}
|
||||||
|
|
||||||
|
{# Load an asciinema file and insert it into the page #}
|
||||||
|
{%- macro asciinema(path, colocated=false, preload=false) -%}
|
||||||
|
{%- set name = path | replace(from='.', to='-') | replace(from='/', to='-') -%}
|
||||||
|
{%- if not page.extra.use_asciinema -%}
|
||||||
|
{{ throw(message='Please set extra.use_asciinema in page front-matter') }}
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
{%- if colocated == true -%}
|
||||||
|
{%- set path = colocated_asset::colocated_asset(path=path, get_url=true) | trim -%}
|
||||||
|
{%- endif -%}
|
||||||
|
|
||||||
|
<div id="asciinema-{{ name }}"></div>
|
||||||
|
<script>
|
||||||
|
(() => {
|
||||||
|
const script = document.getElementById('asciinema-player')
|
||||||
|
const el = document.getElementById('asciinema-{{ name }}')
|
||||||
|
const go = () => {
|
||||||
|
AsciinemaPlayer.create('{{ path | safe }}', el, {preload: {{ preload }} })
|
||||||
|
}
|
||||||
|
// the script could have already loaded
|
||||||
|
if (window.AsciinemaPlayer != null) {
|
||||||
|
go()
|
||||||
|
} else {
|
||||||
|
script.addEventListener('load', go)
|
||||||
|
}
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
{%- endmacro asciinema -%}
|
||||||
|
|
@ -1,10 +1,16 @@
|
||||||
<!--
|
{#
|
||||||
Returns the file path of the colocated asset.
|
Returns the file path of the colocated asset.
|
||||||
When Zola uses `resize_image` it looks relative to the `content` folder.
|
When Zola uses `resize_image` it looks relative to the `content` folder.
|
||||||
This means you have to reference the full page asset colocation path.
|
This means you have to reference the full page asset colocation path.
|
||||||
-->
|
|
||||||
{%- macro colocated_asset(path) -%}
|
The get_url parameter specifies whether you want the URL or the file path.
|
||||||
{%- set page_url_components = page.relative_path | default(value=section.relative_path) | split(pat='/') -%}
|
#}
|
||||||
{%- set page_base = page_url_components | slice(end=page_url_components | length - 1) | join(sep='/') -%}
|
{%- macro colocated_asset(path, get_url=false) -%}
|
||||||
{{ page_base ~ '/' ~ path }}
|
{%- if get_url -%}
|
||||||
|
{{ page.path ~ path }}
|
||||||
|
{%- else -%}
|
||||||
|
{%- set page_url_components = page.relative_path | default(value=section.relative_path) | split(pat='/') -%}
|
||||||
|
{%- set page_base = page_url_components | slice(end=page_url_components | length - 1) | join(sep='/') -%}
|
||||||
|
{{ page_base ~ '/' ~ path }}
|
||||||
|
{%- endif -%}
|
||||||
{%- endmacro colocated_asset -%}
|
{%- endmacro colocated_asset -%}
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,11 @@
|
||||||
<meta property="og:description" content="{{ config.description }}" />
|
<meta property="og:description" content="{{ config.description }}" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if page.extra.use_asciinema %}
|
||||||
|
<script id="asciinema-player" defer type="text/javascript" src="{{ get_url(path='js/asciinema-player.min.js', cachebust=true) | safe }}"></script>
|
||||||
|
<link type="text/css" rel="stylesheet" href="{{ get_url(path='css/asciinema-player.css', cachebust=true) | safe }}">
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endblock pagemeta %}
|
{% endblock pagemeta %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
@ -32,7 +37,7 @@
|
||||||
|
|
||||||
{{ page.content | safe }}
|
{{ page.content | safe }}
|
||||||
|
|
||||||
{% if config.extra.debug and config.mode == "Serve" %}
|
{% if config.extra.debug %}
|
||||||
<pre><code>{{ __tera_context | escape | safe }}</code></pre>
|
<pre><code>{{ __tera_context | escape | safe }}</code></pre>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
|
||||||
7
templates/shortcodes/asciinema.html
Normal file
7
templates/shortcodes/asciinema.html
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
{%- import "macros/asciinema.html" as asciinema -%}
|
||||||
|
|
||||||
|
{{ asciinema::asciinema(
|
||||||
|
path=path,
|
||||||
|
colocated=colocated | default(value=false),
|
||||||
|
preload=preload | default(value=false)
|
||||||
|
) }}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue