Fil-C on Nix

Filnix wiki

mbrock/filnix

packages/site/default.nix

The GitHub Pages site: pages/ as is, docs/ rendered with pandoc into docs/*.html, nanofil's Prolog drawn as terms into nanofil/*.html by nanofil/web/dterm.pl, nanofil's Rocq into nanofil/rocq/*.html by nanofil/web/rocq, nanofil's documents (its guide among them) into nanofil/docs/*.html, the nanofil playground in nanofil/play/, and every Nix file of filnix drawn by dterm-nix into nix/*.html. .github/workflows/pages.yml publishes it.

λpkgs, filcc, filnix, nixpkgs
let

For the option index: the flake's modules, and Nixpkgs' NixOS.

16inherit pkgs
lib

One SWI-Prolog for the dterm pages, the playground's build and the playground in the browser (swipl-wasm is 10.1.19).

19swipl=
20play=
import../../nanofil/web/play inherit pkgs filcc swipl;
21proofStates=

The Nix files drawn as pages (dterm-nix): every Nix file of the repository, but for the trees that are not filnix's own Nix: build results (result*) and experiments/, scratch projects with their own flakes. One that does not parse fails the build. The repository's paths are listed for the links of the others.

27rel=
f: lib.removePrefix"./" lib.path.removePrefix../.. f
uses lib used by nixPages repoFiles
28drawn=
λf
let
31parts=
lib.splitString"/" f
uses lib
in
lib.headparts ≢ "experiments" ∧ ¬lib.anylib.hasPrefix"result" parts
uses lib used by nixPages
34nixPages=
lib.filterdrawn maprel lib.fileset.toListlib.fileset.fileFilterf: f.hasExt"nix" ../..
uses drawn lib rel used by src
39repoFiles=
builtins.toFile"filnix-files" lib.concatMapStringsf: relf + "\n" lib.fileset.toList../..
uses lib rel

The option index of the NixOS and finix modules, from evaluating them (dterm-nix/options.nix), as JSON.

44options=
builtins.toFile"filnix-options.json"
builtins.toJSON
47inherit
lib
48evalNixos=
λmodules
import"${nixpkgs}/nixos/lib/eval-config.nix"
51inherit pkgs.stdenv.hostPlatform
system
52inherit
modules
54inherit
filnix pkgs
55nixpkgsRoot=
56nixpkgsRev=
nixpkgs.rev or "master"
60src=
lib.fileset.toSource
61root=
../..
62fileset=
lib.fileset.unions

nanofil's Rocq, wherever the development puts it (dterm-rocq).

lib.fileset.fileFilterf: f.hasExt"v" ../../nanofil
lib.fileset.unionsmapf: ../.. + "/${f}" nixPages
in
pkgs.runCommand"filnix-site"
77nativeBuildInputs=
pkgs.pandoc swipl
81passthru=
inherit play proofStates;
export ROCQ_PROOF_STATES=${proofStates}
bash ${./.}/build.sh ${src} $out ${repoFiles} ${options} ${nixpkgs} \
${lib.escapeShellArgsnixPages}
cp -r ${play} $out/nanofil/play