Skip to content

matthewdargan/repo

Repository files navigation

Monorepo

Systems programming monorepo centered on a custom C99 standard library. Built for Clang and Linux, managed with Nix/NixOS.

Overview

Custom C99 standard library for systems programming. Layered architecture, unity builds, zero dependencies.

Layer README.md files document APIs (see base/README.md). CLAUDE.md covers project structure and coding standards.

Quick Start

Build and run with Nix:

# Build a tool
nix build .#9p
nix build .#9pfs

# Run directly
nix run .#9mount
nix run .#9pfs

Use -L flag to see full build output including compiler errors:

nix build .#9pfs -L

Development environment loads automatically via direnv, or manually with nix develop.

Architecture

The codebase is organized into layers that depend on each other in a directed acyclic graph. Layers correspond with namespace prefixes - short identifiers (1-3 characters) followed by an underscore that identify which layer code belongs to.

Layer dependency graph:

base/     Custom standard library (no dependencies)
9p/       9P protocol implementation (depends on base/)
cmd/      Command-line tools (depend on base/ and 9p/)

Unity builds: Each layer contains inc.h (includes all header files) and inc.c (includes all implementation files). Applications include these to compile the entire layer at once, improving compilation speed and enabling whole-program optimization.

Documentation

For Developers

  • CLAUDE.md - Complete project context: architecture, layers, coding standards, development workflow

Layer Documentation

Tool Documentation

Conceptual Documentation

Project Structure

Source code:

base/           Custom standard library (arena allocators, strings, OS abstraction)
9p/             9P protocol implementation (client, server, message encoding)
cmd/            Command-line binaries (9mount, 9bind, 9pfs, etc.)
docs/           Architecture and design documentation

Build and configuration:

flake-parts/    Modular Nix flake configuration (shells, packages, pre-commit)
home/           Home Manager user environment configurations
nixos/          NixOS system configurations
packages/       Nix package definitions for each binary

About

monorepo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published