NixOS distribution flake for Framework 16 AMD 7040. The build artifact is an OS (nixosConfigurations.nixos), not an app. Satire in README.md is not documentation. Map: docs/architecture.md. Outputs: flake.nix.
nix develop
nixpkgs-fmt <file.nix> # subflakes; root formatter is nixfmt-rfc-style (`nix fmt`)
nix build .#nixosConfigurations.nixos.config.system.build.toplevel
sudo nixos-rebuild switch --flake .#nixos --impure
nix build .#iso
nix flake check # builds toplevel only; slow gates are packages
nix build .#trvthnvke-docs # docs drift gate: the truth:claim blocks in this file, docs/architecture.md, README.md--impure is required when ~/.config/oligarchy/{local,state}.nix exists. Pure eval silently uses fresh-clone defaults (steam, DSP, persona, etc.) instead of erroring.
Toggles live in configuration.nix (custom.* / services.*). Declaring modules default off; do not edit a module to “turn it on.”
| If you are changing | Start here | Dense? |
|---|---|---|
| Trust, W^X, install | modules/oligarchy-plugins/ + docs/plugins-roadmap.md |
yes |
| Substituter / NAR / peers | modules/oligarchy-p2p/ + docs/p2p-substituter-roadmap.md |
yes |
| Agent surface | modules/mcp-servers/ + docs/mcp-servers-roadmap.md |
yes |
| Egress / hardening | modules/security/ |
yes |
| DSP guest | vm-manager/modules/dsp-vm.nix, modules/dsp-guest.nix |
medium |
| Desktop / theme | home/ |
no — large, not load-bearing |
| Host wiring | flake.nix, configuration.nix |
medium |
Comments next to the code are load-bearing. A 400-line module is often 300 lines of mechanism. Do not “simplify” a comment you do not understand.
- Nobody in
nix.settings.trusted-users. Root-equivalent. Plugins usecustom.plugins.installers+ signed cache. P2P daemon holds no key. - P2P = availability, Nix = trust. Never put
?trusted=1on the substituter URI. Never let the adapter rewrite signed narinfo fields (StorePath,NarHash,NarSize,References). - W^X is mirrored.
Manifest::wx_enforced()inmodules/oligarchy-plugins/host/src/manifest.rsandwxEnforcedinmodules/oligarchy-plugins/modules/plugins.nix. Change both.nix build .#plugins-wx-enforcement. nix store verify --sigs-needed 1is not enough. Content-addressed paths short-circuit;nix store add-pathneeds no privilege. Signature check must require a sig naming atrustedPublicKeyskey and verify.- MCP is stdio, read-only. Reach CLIs only via
runner::run(ASPECT, prog, …)(modules/mcp-servers/crates/core/src/allowlist.rs). No crate binds a socket exceptports-sec(allow-loopback-socket).nix build .#mcp-self-auditfails if.mcp.jsongrows a URL/HTTP transport or ifdcf-mesh-mcp/demod-hypr-bridgeappear there. - Read-write stays out of
.mcp.json:oligarchy-forge,oligarchy-plugins,oligarchy-p2p,dsp-ctl,services.dcf-mesh-agent,services.dcf-hypr-agent. - Do not set
AQ_DRM_DEVICES/WLR_DRM_DEVICEStoward the dGPU. No display path; Hyprland SIGABRTs. Client apps useDRI_PRIME(custom.platform.displayGpu). Assertion inhome/hyprland/default.nix. - Do not import HydraMesh
spa/modules/dcf-spa.nix. It setsnetworking.nftables.enableand fightsdemod-ip-blocker. Usemodules/security/dcf-spa-gate.nix. - New always-on service: add a
lib.mkForce falsein the ISO block inflake.nixif the ISO should stay light. P2P is imported onnixosConfigurations.nixosonly; plugins are onnixosandbuilder(the latter formicrovm.nix). - Secrets: sops-nix. Never commit decrypted material,
*.age, orsecrets/secrets.yaml. Runtime paths only — a repo-relative env file copies into/nix/store. - Pin via flake inputs, not ad-hoc fetches.
allowUnfree = true. Do not re-enableallowBroken(removed on purpose inflake.nix). - DCF Docker images are
:latestand off. Do not enablecustom.dcfCommunityNode/custom.dcfIdentityuntil those images are digests. Bind ports inmodules/hydramesh.nixmust matchmodules/dcf-community-node.nix. - Path subflakes: extra inputs in e.g.
modules/minecraft/flake.nixare not passed by the parent lock (flake.lockminecraft.inputs). PreferfetchFromGitHubinside the subflake, ornix flake lockat the repo root after adding inputs.outputs = { self, nixpkgs, … }:with new required args will eval-fail the whole OS. - Do not
git add -A. Unstage.hermes/, tarballs, literal~/MCP audit dirs,target/. - Never grant a Bluetooth Xbox pad's hidraw node
uaccess. It is the inverse of the fix. nixpkgs'xpadneopackage installs the kernel module alone — no udev rules — so70-xpadneo-disable-hidraw.rules, which sets the hidraw nodeMODE:="0000"andTAG-="uaccess", was absent and SDL's HIDAPI backend claimed the pad through the raw node instead of xpadneo's evdev stream: flawless kernel log, zero input in games.modules/gamepad-bluetooth/installs both rules from thexpadneo-srcinput. Seemodules/gamepad-bluetooth/README.md.
Seven lists must agree (miss one → silent exec failed): crates/core/src/allowlist.rs (ASPECTS + list_for), crates/umbrella/src/main.rs (is_known_aspect + usage), modules/mcp-servers/flake.nix aspectNames, modules/mcp-servers/nixos-module.nix aspectNames, repo-root .mcp.json, modules/mcp-servers/README.md, docs/architecture.md §9. Copy crates/hydramesh or crates/storage. Tools must work unprivileged. Allowlist no deleting binaries.
nix build .#mcp-self-audit
nix build .#malwareScan
nix build .#plugins-wx-enforcement .#plugins-policy-refusal .#plugins-signed-install .#plugins-tier1-runtime
nix build .#plugins-tier2-runtime # nested KVM
nix build .#p2p-substituter-protocol .#p2p-signature-refusal .#p2p-artifact-cache
nix build .#p2p-two-node .#p2p-swarm .#p2p-no-peer-fallback
nix build .#p2p-local-signing .#p2p-peer-scope .#p2p-selftest
cd modules/mcp-servers && cargo test --workspacetests/default.nix is not a flake output. Eval directly if needed: nix-build tests/default.nix -A strict-egress.
Hosts in flake.nix: nixos (primary), nixos-asher (committed hosts/asher/ layer), nixos-fw13 / nixos-intel / nixos-optimus (UUID stubs, unverified), builder. User is custom.user.name (default asher).
Machine-checked by nix build .#trvthnvke-docs. When one of these fails, the code moved; fix the sentence, do not delete the claim.
Rule 3, host side: Manifest::wx_enforced() lives in modules/oligarchy-plugins/host/src/manifest.rs.
Rule 3, Nix side: its mirror wxEnforced lives in modules/oligarchy-plugins/modules/plugins.nix.
Rule 5: the per-aspect CLI allowlist is modules/mcp-servers/crates/core/src/allowlist.rs.
Rules 5 and 6 police the repo-root .mcp.json.
Rule 7's assertion is in home/hyprland/default.nix.
Rule 8's replacement for HydraMesh's SPA module is modules/security/dcf-spa-gate.nix.
Rule 12: the HydraMesh bind ports are declared in modules/hydramesh.nix.
Rule 12: and must match modules/dcf-community-node.nix.
The docs gate itself runs in the eval lane: .github/workflows/eval.yml builds trvthnvke-docs on every push and pull request.