What is the Arroyo System?
The Arroyo Concept Operating System is a method of organizing a cluster NixOS within org-mode documents. You read, write, and create human legible documentation with code and configuration embedded within it, and the system extracts that code (colloquially: "tangles" it) in a a Nix Flake which can deploy and manage a cluster of computers.
Adding new functionality to your system is as simple as downloading plaintext org-mode documents and running the arroyo tool. If you don't know how to use the software, the document itself serves as an introduction to the use and abuse of the software under consideration.
Rebuild of The Complete Computer 0x01: You Can (Not) Compute
Rebuild of the complete computer 0x02: This is (Not) Advanced
Prerequisites
Linux host or VM to run this bootstrap environment.
Nix with flakes (
experimental-features = nix-command flakesin~/.config/nix/nix.conf)Emacs with org-mode or another system with org-mode editing capabilities or syntax highlighting.
cce-emacscan give you an opinionated one of these.arcology tangle tool (see arcology2go)
Set up you ~/org
You'll use ~/org to organize your life, and it will in turn organize your computer in ~/nix.
Start by cloning this arroyo system repository in to ~/org/arroyo-system. This contains this bootstrap document and template files which will tangle to ~/nix. You'll edit these files to add new systems to your cluster.
shell source:git clone -b template http://code.rix.si/rrix/arroyo-system ~/org/arroyo-system git -C ~/org/arroyo-system checkout -b $USER
cce-core contains a base NixOS distribution, a set of decent defaults that work will with this system.
shell source:git clone https://code.rix.si/rrix/cce-core ~/org/cce-core
cce-workstation defines a KDE desktop suitable for your NixOS Endpoint NixOS Endpoint.
shell source:git clone https://code.rix.si/rrix/cce-workstation ~/org/cce-workstation
cce-emacs gives you an Emacs suitable for working within the Arroyo Concept Operating System .
shell source:git clone https://code.rix.si/rrix/cce-emacs ~/org/cce-emacs
cce-wobserver sets up a private cluster of sovereign web services. It serves as the "hub" of the Concept Operating System.
shell source:git clone https://code.rix.si/rrix/cce-wobserver ~/org/cce-wobserver
arcology2go is the application which provides the tangle tool, an Android org-mode journaling app, and an org-mode web publishing platform. If you don't want to set up the Wobserver you can probably just nix run this but you might want it on hand.
shell source:git clone https://code.rix.si/rrix/arcology2go ~/org/arcology2go
Tangling and flooding
You can start by running
shell source:nix run git+http://code.rix.si/rrix/arcology2go -- flood --db ~/org/arcology.db
This populates a SQLite3 database with metadata extracted from these org-mode files, then uses that metadata to generate the Arroyo System Flake . File keywords and heading properties like :ARROYO_SYSTEM_OUTPUT:, #+ARROYO_SYSTEM_ROLE, :ARROYO_NIXOS_MODULE: used by the Flake generator to define Flake inputs and outputs. The tangle tool executes Lua embedded in the documents to answer requests like "give me a list of all the NixOS modules for the endpoint role" and embed that in the nixosConfiguration output definition for your laptop.
If you chose to include
arcology2goin your ~/org, you should now have anarcologycommand in your PATH, otherwise you can keepnix run'ing it.floodre-tangles everything and reindexes the DBarcology tangle ./<file>.org --db ~/org/arcology.dbfor iterative single-file workstructural changes to
ARROYO_INPUT/ARROYO_OUTPUT/ARROYO_NIXOS_MODULEkeywords require a flood (tangleretangles source blocks but reads keywords from the stale DB)
Defining your first host
Copy the
myhostheading insystems.orgSet
networking.hostNameandsystem.stateVersionWrite a
hardware-configuration.nix(usenixos-generate-configon the target machine) and place the contents of it in the host definition.The
#+ARROYO_OUTPUT:keyword declares the host output snippetThe
:ARROYO_SYSTEM_ROLE:property filters which modules the<<host-modules("endpoint")>>Lua generator pulls in
Building and switching
shell source:nixos-rebuild switch --flake ~/nix#myhost
After any org edit: arcology tangle (or flood for structural changes) → nixos-rebuild switch.
Adding modules
Use #+ARROYO_NIXOS_MODULE: / #+ARROYO_HOME_MODULE: / :ARROYO_SYSTEM_ROLE: keywords in org headings to register modules. Example:
org source:** My Module :PROPERTIES: :ID: my-module :ARROYO_NIXOS_MODULE: nixos/my-module.nix :ARROYO_SYSTEM_ROLE: endpoint :END: #+begin_src nix :tangle ~/nix/nixos/my-module.nix { ... }: { services.some-thing.enable = true; } #+end_src
The cce-* repos are the canonical corpus of example modules.
Adding flake inputs
Use #+ARROYO_INPUT: to declare flake input snippets. Example (home-manager-input.nix):
org source:#+begin_src nix :tangle ~/nix/snippets/home-manager-input.nix :mkdirp yes home-manager = { url = "github:nix-community/home-manager/release-26.05"; inputs.nixpkgs.follows = "nixpkgs"; }; #+end_src
The four roles
endpoint— laptops and desktops (full desktop, home-manager, Emacs)server— the Wobserver (community homeserver)settop— HTPC / media centeredge— edge server VM (proxy in front of the Wobserver)droid- t184256/nix-on-droid environment
Pick one per host via :ARROYO_SYSTEM_ROLE:.
Verification
shell source:nix --extra-experimental-features nix-command --extra-experimental-features flakes \ flake check ~/nix --no-build
This is the only "test" the project has.
Where to go next
The cce-* repos cloned above are the example of a complete Arroyo System. The creator's Website is a good place to go. Go deploy your own cluster.
Troubleshooting
arcology tangledoesn't reindex the DB, onlyflood(orindex) updates keyword rows.property drawers only allow one of each keyword, multiples in one drawer silently overwrite. The parser will split
ARROYO_*keywords on spaces (:ARROYO_SYSTEM_ROLE: endpoint server)