stereOS is a Linux based operating system purpose built for AI agents.
stereos/
├── flake.nix # Thin entry point — delegates to flake/ modules (flake-parts)
├── flake.lock
├── flake/ # flake-parts module files (split flake.nix logic)
│ ├── devshell.nix # Per-system: toolchains, developer shell for direnv
│ ├── images.nix # Per-system: image build targets (raw, qcow2, kernel-artifacts)
│ └── checks.nix # Per-system: CI verification builds
│
├── modules/ # NixOS modules — the core of the OS
│ ├── default.nix # Aggregator (imports all sub-modules)
│ ├── base.nix # Core OS: filesystem, SSH, nix settings, packages, hardening
│ ├── boot.nix # Boot config + boot-time optimizations (sub-3s boot target)
│ ├── services/
│ │ ├── stereosd.nix # stereosd service overrides (tmpfiles, firewall, DynamicUser)
│ │ └── agentd.nix # agentd service overrides (ordering, DynamicUser)
│ └── users/
│ ├── agent.nix # Agent user: restricted shell, ~/workspace, sudo denial, options
│ └── admin.nix # Admin user: wheel/admin group, passwordless sudo
│
├── profiles/ # Composable configuration presets
│ ├── base.nix # Shared foundation (imports all image formats)
│ └── dev.nix # Dev-only: SSH key injection, debug tools
│
├── mixtapes/ # Mixtapes — spins with specific packages/configs
│ ├── base/
│ │ └── package.nix # Base system — no extra agent tooling
│ └── coder/
│ └── package.nix # All AI coding agents (claude-code, gemini-cli, opencode)
│
├── formats/ # Image format definitions
│ ├── raw-efi.nix # Raw EFI disk image (canonical artifact)
│ ├── qcow.nix # QCOW2 image (for QEMU/KVM)
│ └── kernel-artifacts.nix # Direct-kernel boot (bzImage + initrd + cmdline)
│
├── lib/ # Shared Nix helper functions
│ └── default.nix # mkMixtape helper
│
├── scripts/
│ └── run-vm.sh # QEMU VM launcher
├── Makefile # Build command runner (make help for targets)
└── .envrc # direnv integration for nix flake dev shell
Every mixtape is assembled by lib/default.nix:mkMixtape, which calls
nixpkgs.lib.nixosSystem with:
- External flake modules (
agentd,stereosd) + their overlays - The stereOS module tree (
modules/) - The shared base profile (
profiles/base.nix) - Mixtape-specific feature modules (e.g.
mixtapes/coder/package.nix) - Optional extra modules (e.g.
profiles/dev.nixfor dev builds)
mkMixtape {
name = "coder";
features = [ ./mixtapes/coder/package.nix ];
# extraModules = [ ./profiles/dev.nix ]; # dev builds only
}- When writing Go, always use the Ginkgo/Gomega testing frameworks
- Always use
makeoperations for development: usemake helpto understand the various operations available. - Follow idiomatic Go and prefer using the
func NewExampleStruct() *ExampleStructparadigm throughout.