Manzil's bundled linker consumes v3 manifests with an explicit contract section:
{
"version": 3,
"contracts": {
"target_root": "/home/alice",
"source_roots": ["/nix/store"]
},
"files": [
{
"type": "symlink",
"target": "/home/alice/.zshrc",
"source": "/nix/store/...-zshrc"
}
]
}Contracts make the manifest machine-checkable before any filesystem mutation happens. They let the linker reject manifests that would:
This reduces hidden behavior and makes the linker safer to reuse in tests and automation.
contracts.target_rootEvery manifest target must stay under this root. For Manzil-generated manifests, that is the user's managed home directory.
contracts.source_rootsEvery source path must stay under one of these roots. For Manzil-generated manifests, that is currently the Nix store.
The bundled linker validates:
target_rootsource_rootsValidation happens in 2 layers:
That keeps manifests machine-checkable before mutation while still rejecting symlinked-parent escapes and resolved sources outside the declared roots.
manzil.linker = null does not use manifest contracts.
That mode only supports a reduced subset of the file model and should be
treated as a compatibility fallback.
Typical failure cases:
/nix/storeIf a build fails, inspect the generated manifest first. The helper
library exposes manifestForUser, and the NixOS tests in
this repository also exercise contract validation directly.