Fil-C on Nix

Filnix wiki

mbrock/filnix

tests/native-exceptions-table.nix

docs/nixos.md's table of built-in native exceptions is generated from lib/native-exceptions.nix; this fails when the two differ. Print the table to paste between the markers with

nix eval --raw .#checks.x86_64-linux.native-exceptions-table.table
λpkgs
let
8inherit pkgs
lib

Both systems' first, then NixOS's, then finix's.

11group=
λe
lib.lengthe.os ≡ 2
→
0
lib.elem"nixos" e.os
→
1
else
2
uses lib used by names
19names=
lib.sorta: b: groupdata.${a} < groupdata.${b} ∨ groupdata.${a} ≡ groupdata.${b} ∧ a < b lib.attrNamesdata
uses data group lib used by table
24mark=
os: e: if lib.elemos e.os then "✓" else ""
uses lib used by table
25table=
| Package | NixOS | finix | Why |
| --- | --- | --- | --- |
+
lib.concatMapStrings
λn
let
32e=
data.${n}
uses data
in
"| `${n}` | ${mark"nixos" e} | ${mark"finix" e} | ${e.why} |\n"
uses lib mark names
in
pkgs.runCommand"native-exceptions-table"
39inherit
table
40passAsFile=
"table"
41passthru=
inherit table;
sed -n '/<!-- native-exceptions -->/,/<!-- \/native-exceptions -->/p' ${../docs/nixos.md} |
sed '1d;$d' > docs
if ! diff -u docs "$tablePath"; then
echo "docs/nixos.md: replace the table between the native-exceptions markers with" >&2
echo " nix eval --raw .#checks.x86_64-linux.native-exceptions-table.table" >&2
exit 1
fi
touch $out