Fil-C on Nix

Filnix wiki

mbrock/filnix

filnix, read as Nix

Every Nix file of filnix, drawn by what it is rather than how it was typed: attribute sets as tables of bindings, let as bindings over a body, function arguments as signatures, if and mkIf as tables of conditions, ports as tables of their steps, options with their descriptions as prose. Each name links to where it is bound, and each let binding lists what uses it. Drawn by dterm-nix, after nanofil's dterm.

Evaluated

OptionsEvery option the exported NixOS and finix modules declare or set: type, default, description, where it is declared and defined, its value and the port that builds it, and which modules read it.

top level

build-filc.nixBuild the complete Fil-C compiler with all dependencies102 lines
demo.nix139 lines
flake.nix887 lines
ports.nixFil-C package ports - list-based structure3976 lines
pyports.nixPython package ports using the same DSL as ports2.nix418 lines
rubyports.nixSee docs/ruby-filc-porting-patterns.txt for common porting patterns.261 lines
toolchain.nix50 lines
virt.nix49 lines

bench/

php/default.nixPHP 8.5 application benchmark: native Nixpkgs PHP against pkgsFilc.php85 (release Fil-C), pkgsFilcStaging.php85 (the staging toolchain) and pkgsFilcStaging.p…63 lines

compiler/

filc.nix138 lines
filc0.nix217 lines
libcxx.nix62 lines

demo/

default.nix46 lines
libei/cnode.nix52 lines
libei/default.nix84 lines
perl/default.nixPerl + C Integration Demos with Fil-C Memory Safety74 lines

deploy/

analytics/default.nix34 lines
cache/default.nix21 lines

dterm-nix/

options.nixThe options of filnix's modules as evaluation knows them, as JSON for dterm-nix's option index (dterm_nix.pl --options).311 lines

emacs/

emacs.nix108 lines

experiment/

default.nix33 lines
planner.nix37 lines
python.nix42 lines

finix/

default.nixfinix module: a finix system whose pkgs is the Fil-C package set (lib/filc-system.nix), so finit, PAM, OpenSSH and every service are Fil-C.23 lines
demo.nixA small finix machine whose whole userland is Fil-C: finit as PID 1, mdevd, sysklogd, dhcpcd, OpenSSH, the shell and the tools are Fil-C builds; only the ker…93 lines
test.nixBoot the example finix machine (finix/demo.nix) with finix's own VM test driver and check that its userland is Fil-C: PID 1, the shells and sshd map the Fil-…125 lines

httpd/

config/lighttpd.nix60 lines
default.nix82 lines
demo-runner.nix134 lines
lib/builders.nix101 lines

lib/

block-rust-go.nixA stdenv adapter that marks Rust and Go derivations broken.69 lines
default.nix216 lines
filc-system.nixThe Fil-C system: a NixOS or finix machine whose pkgs is filnix's Fil-C package set.169 lines
native-exceptions.nixThe packages a Fil-C system always takes from native Nixpkgs, with the operating systems that need each one and why.84 lines
sources.nix86 lines

nanofil/

bench/default.nixThe runtime benchmark's binaries and inputs (docs/perf.md).121 lines
bench/profile/checks.nixThe benchmark's programs built for counting executed access checks (checks.py, docs/perf.md item 16): filcc -O2 with its check scheduler in each configuratio…139 lines
bench/profile/default.nixThe benchmark's programs built by a marked nanofil for instruction attribution (docs/perf.md): marks.patch puts a local label before each IR instruction, ABI…80 lines
bench/programs.nixThe benchmark's programs: for a C compiler cc (a path), a derivation per program with its executable at the top of $out.71 lines
bench/swipl.nixSWI-Prolog 9.2.9's core (no packages) for the profile in docs/perf.md: built by plain clang (native), by filcc (ref) and by nanofil -O (O), from the sa…91 lines
nix/bash.nixGNU bash 5.3 (patch level 9, as nixpkgs pins it) built entirely by nanofil, with nixpkgs' patches and filnix's bash port patch (the unwind_prot buffer that s…84 lines
nix/bzip2.nixbzip2 1.0.8 built entirely by nanofil.80 lines
nix/check.nixnanofil: unit tests, then the IR fixtures, the backend regressions and a seeded random corpus run through the interpreter and nanofil's own backend, which mu…449 lines
nix/configurations.nixA program check split into one derivation per nanofil configuration, so the configurations build in parallel instead of one after another.22 lines
nix/coreutils.nixGNU coreutils 9.11 built entirely by nanofil, with nixpkgs' source patches and filnix's coreutils port patch (without its tests/local.mk hunk, which would ne…128 lines
nix/corpus.nixSource licenses remain in each fetched tree (cproc: ISC, test/*: Unlicense; c-testsuite: per-test .otag provenance, not the runner's MIT).16 lines
nix/dash.nixdash 0.5.13.3 built entirely by nanofil, with filnix's dash port patch (fork for vfork: a vforked child would share the collector's heap).46 lines
nix/hello.nixGNU hello built entirely by nanofil, then its own test suite.79 lines
nix/jq.nixjq 1.8.2 built entirely by nanofil, with its bundled oniguruma (regular expressions) and decNumber (number literals).70 lines
nix/lua.nixLua 5.4 built entirely through the shared nanofil-cc wrapper.75 lines
nix/lz4.nixlz4 1.10.0 built entirely by nanofil.79 lines
nix/make.nixGNU make 4.4.1 built entirely by nanofil, with filnix's make port patch and nixpkgs' source patches (those that need no autoreconf).97 lines
nix/nanofil-cc.nixnanofil-cc: a CC for building C packages with nanofil.85 lines
nix/python.nixCPython 3.12.5 built entirely by nanofil, with filnix's port of it (ports.nix's python312: the Fil-C patch, pymalloc and freelists off, no x87 or x64 inline …191 lines
nix/rocq.nixThe Rocq model of the checked IR (rocq/, docs/formal.md Campaign 1): default: model + parse.sh + a small outcome/base-verdict smoke corpus.210 lines
nix/sed.nixGNU sed 4.10 built entirely by nanofil, with filnix's sed port patch.69 lines
nix/sqlite.nixSQLite 3.51.2 (the amalgamation and its shell) built entirely by nanofil, single-threaded, with FTS5 and the math functions as nixpkgs enables them.101 lines
nix/swipl.nixSWI-Prolog 9.2.9 built entirely by nanofil, with filnix's port of it (ports.nix's swi-prolog: patches/swi-prolog-9.2.9-filc.patch) and the port's packages: t…213 lines
nix/trealla.nixNative Trealla at the revision filnix builds under Fil-C (ports.nix), for fast development runs.29 lines
nix/xz.nixxz-utils 5.8.4 built entirely by nanofil, with filnix's xz port patch (its C changes; the Makefile.am one only matters for shared liblzma).73 lines
nix/zlib.nixzlib built entirely by nanofil.73 lines
survey/default.nixThe nanofil package survey (docs/survey.md).148 lines
web/play/default.nixThe nanofil playground: nanofil on SWI-Prolog 10.1.19 in WebAssembly, drawing what it makes of a C file with dterm (README.md).86 lines
web/play/swipl.nixNative SWI-Prolog at the revision swipl-wasm is built from, so the playground's build (the frozen profile, the page's Prolog) and the browser run one SWI.26 lines
web/play/trealla-wasm.nixTrealla as a WASI command (tpl.wasm), at the revision and with the patches nanofil runs on natively (../../nix/trealla.nix), for the playground.40 lines
web/rocq/capture.nixCache prover execution independently of the presentation assets.38 lines

nixos/

amazon.nixThe base Fil-C NixOS (nixos/base.nix) as an Amazon EC2 machine, for the public AMI that .github/workflows/ami.yml registers.119 lines
base.nixThe base Fil-C NixOS machine that filnix ships as a disk image: a whole Fil-C system (nixos/default.nix) set up to try.179 lines
default.nixNixOS module: a NixOS whose pkgs is the Fil-C package set (lib/filc-system.nix), so systemd, PAM, D-Bus and every service are Fil-C.69 lines
demo-wiki.nixhttps://filc.less.rest: a public Fil-C server on EC2, booted from the filnix AMI (nixos/amazon.nix).226 lines
image.nixThe base Fil-C NixOS image (nixos/base.nix) and what runs it:59 lines

packages/

bind-dist/default.nixA relocatable BIND 9 distribution for ordinary x86-64 Linux systems, built like php-dist: the tarball carries the Fil-C runtime, glibc and every library the …57 lines
bind-dist/docker.nixAn OCI image of the bind-dist tree, laid out like ISC's official internetsystemsconsortium/bind9 images: programs in /usr/bin and /usr/sbin, the configuratio…100 lines
filroot/default.nixA relocatable Fil-C root: the same toolchain and programs as optfil, in a directory that works wherever it is unpacked, also read-only.77 lines
kitty-doom.nix64 lines
libei.nix98 lines
libmicrohttpd.nix14 lines
minilute.nix38 lines
optfil/default.nixFil-C at /opt/fil for ordinary x86-64 Linux systems, in the layout of upstream's optfil distribution: the filcc and fil++ compiler with its runtime, glibc, l…182 lines
php-dist/default.nixA relocatable PHP distribution for ordinary x86-64 Linux systems.153 lines
php-dist/docker.nixAn OCI image of the php-dist tree, laid out like the official php images: PHP in /usr/local/bin, the document root in /var/www/html, and php − a by default.66 lines
projeny.nix85 lines
qnode/default.nixqnode: the node-compat shim in qnode.js, run by QuickJS.27 lines
qnode/npm-cli.nixRehost a pure-JS npm CLI on qnode.42 lines
sarcasm-prolog.nix31 lines
sarcasm.nix36 lines
site/default.nixThe 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…89 lines
wasm3-cves.nixCVE test payloads for wasm334 lines
wasm3.nix36 lines

ports/

boehmgc/default.nixThe Boehm GC API on Fil-C's own collector (docs/boehm-on-fugc.md).111 lines
build-tools.nixBuild-platform code generators whose output targets Fil-C.284 lines
default.nixFil-C Ports DSL and Overlay Infrastructure435 lines
determinate-nix.nixDeterminate Systems' Nix fork (github.com/DeterminateSystems/nix-src), built with Fil-C.130 lines
expected.nixCompatibility expectations, not the inventory of port recipes.110 lines
jemalloc/default.nixjemalloc's API on Fil-C's allocator (docs/jemalloc-on-fugc.md).72 lines
lua.nix54 lines
media.nixFocused repairs for shared graphics and codec dependencies.107 lines
openssl-sarcasm.nix26 lines
openssl.nix102 lines
overlay.nixOverlay for Fil-C ported packages1152 lines
patches.nixHistorical import inventory; not consumed by the active overlay.427 lines
perl-modules.nixFixes for CPAN modules in the Fil-C Perl package set (an overrideScope overlay, see perl5 in ../ports.nix).110 lines
perlPorts-as-overlay.nixPerl package overrides7 lines
pipewire-consumers.nixPipeWire consumers ported against the full PipeWire package.138 lines
pythonPorts-as-overlay.nixConvert pythonPorts.nix list to packageOverrides function131 lines
qt5.nixQt 5.15 for Fil-C, as an override of the qt5 scope (libsForQt5 is built from final.qt5, so its packages see these modules too).248 lines
qt6.nixQt 6 for Fil-C. Check with:82 lines
ruby.nix26 lines
rubyPorts-as-gemConfig.nix61 lines
tpm2.nixTPM2's mocks must retain pointers, including Fil-C capabilities.62 lines
tree-sitter.nixtree-sitter's CLI is Rust, which has no Fil-C target.32 lines
zstd-sarcasm.nix32 lines

runtime/

compiler-rt.nixBuild compiler-rt for CRT files and builtins80 lines
filc-glibc.nix110 lines
libpizlo.nix112 lines
llvmjit.nixlibfilcllvmjit.so, the native shim behind Fil-C's LLVM JIT API, built the way upstream's libpas/build_llvmjit.sh builds it.58 lines
yolo-glibc.nix118 lines
yolounwind.nixBuild yolounwind stub library50 lines

scripts/

audit-port-versions.nixEvaluate the active declarations, rather than the historical patches.nix table.70 lines
package-inventory.nixNative package metadata only: no derivation paths, source realization, or builds.95 lines
query-package.nixQuery comprehensive package information from nixpkgs209 lines

shells/

baseline.nix141 lines
filc-llvm.nixShell for hacking on the Fil-C LLVM/Clang (FilPizlonator, clang CodeGen) outside Nix with incremental ninja builds.78 lines
wasm3-cve-test.nix39 lines
world-packages.nixOrdered roots for the bounded Fil-C world package cohort.96 lines
world.nix84 lines

tests/

boost-context.nix14 lines
cmocka-pointer-mocks.nix26 lines
cxx-coroutines.nixC++20 coroutines (lowered before FilPizlonator) and musttail calls.33 lines
dbus-glib.nixdbus-glib consumer check: a Fil-C service and client exchange scalars, containers, a struct, a variant dictionary and a signal through dbus-binding-tool glue…46 lines
determinate-nix/drvs-chunk.nixdrvs.nix, restricted to names whose index is k modulo n (to bound memory).33 lines
determinate-nix/drvs.nixEvery top-level derivation's drvPath (null when it fails to evaluate).34 lines
determinate-nix/nixos.nixSeveral NixOS systems' toplevel drvPaths, forced in parallel by nixeval − −json.38 lines
determinate-nix/par.nixbuiltins.parallel: start every top-level drvPath in the background, then collect them on the main thread.40 lines
determinate-nix/pollute.nix6 lines
determinate-nix/race.nixMany attributes share one failing thunk.20 lines
determinate-nix/race3.nixForce one failing thunk from many threads (builtins.parallel + tryEval), then report it once more.13 lines
emacs-treesit.nix13 lines
experiment-calibration.nix34 lines
fenv.nix13 lines
fltk.nixExercise installed CMake targets, including their transitive link dependencies.47 lines
fork-regressions.nixCompiler and runtime fixes in the mbrock/fil-c fork, each found by a port: __sync pointer atomics (cffi), unions inside by-value records (fmt), function desc…92 lines
gc-local-arrays.nix13 lines
generator-precedence.nixNative build tools propagate the ordinary GLib and GI into Fil-C builds (gdk-pixbuf, PyGObject).28 lines
gi-link-environment.nix46 lines
glib-atomic.nix13 lines
glib-enums.nix19 lines
glib-gtype.nix22 lines
glib-networking.nix14 lines
glibc-dirwalk.nixnftw, ftw, scandirat and fts walk subdirectories (patches/filc-glibc-openat-nocancel.patch).15 lines
glibc-settimezone.nixsettimeofday(NULL, tz) reaches the kernel instead of stopping the program (patches/filc-glibc-settimezone.patch).15 lines
glibc-syscall-fallbacks.nixsbrk(0) reports the break; moving it, sched_setattr and pidfd_spawn fail instead of stopping the program (patches/filc-glibc-unsupported-syscalls.patch).15 lines
glibmm.nixglibmm runtime check for both API series (2.4 and 2.68): a derived object type with a property and signal, GValue boxing, variants, wrap() and a Gio list mod…25 lines
gnutls-tls.nixRun GnuTLS's TLS, certificate and slow suites separately from gnulib's allocator/stack/inline-assembly portability probes.36 lines
graphite2.nixExercise the installed shaper with upstream goldens, not the build-tree DLL.50 lines
gtk-ports.nixEvaluate with --option allow-import-from-derivation false; builds nothing.118 lines
gtk-runtime.nix43 lines
gtk2-runtime.nix43 lines
gtkmm.nixgtkmm runtime checks on a Broadway display; see gtkmm/gtkmm*-runtime.cc.44 lines
icu.nix15 lines
libaom.nixExercise the installed allocator and encoder, including the capability-bearing allocation header shared by lookahead, partitioning and coefficient buffers.18 lines
libffi.nix17 lines
libsoup.nix28 lines
libtool-symbols.nixExercise the installed compiler setup hook and real libtool probes, including configure generated in preConfigure rather than shipped in a source archive.93 lines
link-hygiene.nixWrapper behaviour every Fil-C link relies on: ld − r works (the runtime's shared libraries are not added to relocatable links), and code inlined from a depe…48 lines
link-wrap.nix40 lines
llvm-jit.nixFil-C's LLVM JIT API: build LLVM IR in a Fil-C program, compile it through the Fil-C passes in-process, and call it.39 lines
locale.nix13 lines
media-foundations.nix19 lines
media.nixInstalled API checks, without a display server or target encoder dependency.37 lines
native-exceptions-table.nixdocs/nixos.md's table of built-in native exceptions is generated from lib/native-exceptions.nix; this fails when the two differ.53 lines
nix-eval.nixRun the Fil-C Nix: evaluate expressions and add a file to a local store.19 lines
nixos/apache.nixFil-C Apache under load, prefork and event: the scoreboard (mod_status), the shmcb TLS session cache, mod_cache_socache, mod_auth_digest's client table, NixO…203 lines
nixos/default.nixNixOS VM tests of Fil-C systems: Nixpkgs' own tests of each service, run with nixosModules.default on every node, plus tests of our own.257 lines
nixos/demo-wiki.nixnixosConfigurations.demo-wiki (nixos/demo-wiki.nix) in a VM: without the EC2 metadata service and Let's Encrypt, which the VM has neither of, so lighttpd ser…92 lines
nixos/first-switch.nixThe AMI's first boot (nixos/amazon.nix) with #filnix user data: the filnix-first-switch unit switches to the named system while boot goes on.72 lines
nixos/php-lighttpd.nixPHP-FPM behind lighttpd over FastCGI, both Fil-C builds: the web stack the module offers, since it has no nginx switch.62 lines
nixos/redis.nixNixpkgs' redis test (nixos/tests/redis.nix) builds with the old make-test-python and can't be imported as a module; this is its machine and script, with the …46 lines
nixos/userland.nixA NixOS VM whose whole userland is Fil-C (nixosModules.default): it boots, a user logs in on the console, PID 1 and the main services map the Fil-C runtime, …112 lines
openssl-sarcasm.nix20 lines
pch-union.nixRecords that contain a union keep Fil-C's union handling when they come from a precompiled header.26 lines
perl-xs-pointers.nixPerl XS modules that pass pointers to each other or back to Perl code: Encode's table encodings live in Encode::Byte and friends, which hand their encode_t p…30 lines
php-stealmybitcoin.nixDifferential verification of the StealMyBitcoin exploit against the two PHP 8.4.25 builds filnix pins: Nixpkgs' unstripped PHP 8.4.25, on which the adapted P…52 lines
pipewire-consumers.nix44 lines
pipewire.nix18 lines
pointer-tagging.nixWhich pointer-tagging patterns keep their capabilities (docs/filc-findings.md).14 lines
port-names.nixA bare port, (for pkgs.X [ … ]), is keyed by the pname of pkgs.X (ports/default.nix, makeOverlay), so it lands on pkgsFilc.<pname>.84 lines
port-version-refresh.nix63 lines
protobuf.nixGenerate C++ with the Fil-C protoc and round-trip messages through the Fil-C runtime: binary, text and JSON formats, a JSON error (a heap-backed absl::Status…28 lines
pthread-pi.nix13 lines
pthread-spin.nix13 lines
pygobject.nix9 lines
python-decimal.nixCPython's decimal module uses the system libmpdec.15 lines
python-protobuf.nixFil-C Python's protobuf uses the pure-Python backend (the upb extension is not ported); round-trip protoc-generated messages through it.14 lines
qnode.nixThe qnode-hosted CLIs must match their Node.js builds byte for byte.26 lines
qt5.nixBuild small Qt 5 programs with the Fil-C qmake and run them on the offscreen platform and on X11 (a native Xvfb).125 lines
qt6.nixQtBase/Svg and QML/Quick/Controls 2 runtime coverage, with native host tools.86 lines
quadprogpp.nixExercise the installed CMake target, including its transitive math dependency.35 lines
re2.nixMatch, replace and run the DFA of re2 (and its abseil headers) under Fil-C.17 lines
runtime-prctl-caps.nixprctl's capability options reach the kernel (patches/filc-runtime-prctl-caps.patch).15 lines
sarcasm-fixes.nixRegression tests for our SaRCAsm .rept and call-argument carrier fixes, merged in release 0.687 (pizlonator/fil-c#336, #337).32 lines
sarcasm-prolog.nix196 lines
sarcasm.nix22 lines
sealed-closures.nixSealed closures (zclosure_new_sealed, staging only): the body reads its data, and every other way through the closure to that data is a safety error.35 lines
tpm2-tools.nixExercise the installed Fil-C tools and broker against an isolated software TPM.26 lines
trealla.nix45 lines
unsafe-call-boundary.nix35 lines
wrapper-roles.nixThe Fil-C compiler and bintools wrappers must not share a role salt with the native ones.47 lines
zmark-shared.nixzmark_shared regressions (docs/zmark-shared.md): pointers stored in a marked shared mapping after fork are usable by every process; foreign pointers are refu…32 lines
zstd-sarcasm.nix44 lines

toolchain/

binutils.nix59 lines
broadway-check.nixRun GTK3 package tests against the backend enabled by the Fil-C GTK port.45 lines
meson-check-cores.nixMeson concurrency alone does not bound tests that size their own thread pools from sched_getaffinity().17 lines
sysroot.nix35 lines
test-wrap.nixA package-local compiler adapter; the shared compiler derivation is unchanged.11 lines
wrappers.nix204 lines

tools/

runfilc.nix32 lines
uacme.nix119 lines

ttyd-demo/

default.nix141 lines

virt/

common.nix31 lines
core.nix324 lines
docker.nix50 lines
filc-world-docker.nix46 lines
nspawn.nix33 lines
qemu.nix164 lines
vm-config.nix37 lines