Files
README.md

Randoneering's Multi-System Nix Flake #

This flake manages my various computing environments, providing a unified way to configure different machines while allowing for necessary host-specific customizations.

The Philosophy #

My approach here is to treat each machine not as a standalone box, but as a specific instantiation of a shared, well-defined system. We pull in shared logic—like networking setups, my favorite editors, and database tooling—into central modules. Then, we apply tailored overrides in the host configuration to make each machine feel uniquely suited to its purpose.

What's in This Repository? #

This repository serves as my central configuration hub, containing:

  • flake.nix: The root of the system, tying everything together.
  • modules/: The shared brain. Here lives the generalized configuration for system features (like desktop, llm, database).
  • home/: My digital toolkit. This handles personal settings like shell configurations, preferred programming environments (Python, Rust, etc.), and secret management via Home Manager.
  • hosts/: The body of the system. These folders define what each specific machine is—the NixOS target, the hardware profile, the user context.
  • secrets/: Keeping things private. Configuration data that needs to be encrypted is managed here using SOPS.

Custom packages #

t3code is pinned in pkgs/t3code/default.nix and available as pkgs.t3code on every host. Add it to environment.systemPackages or Home Manager's home.packages to install it. Build it directly with nix build .#t3code. Updating the release requires updating the source and dependency hashes and checking the build against the pinned nixpkgs-unstable recipe.

Hosts #

I've defined several specific environments for different tasks:

Environment Name Folder Purpose/Notes
nix-wks hosts/wks LLM Server
nix-lemur hosts/lemur My travel machine and one of my favorite laptops (system76 lemur pro)
nix-l15 hosts/l15 Work laptop and main machine

nix-l15 host-local policies #

hosts/l15/default.nix sets laptop-only policies. users/justin/home.nix adds laptop-only Home Manager tools. Other hosts keep their existing settings and packages.

  • TERMINAL=kitty overrides the shared ghostty setting.
  • cocore uses PrivateDevices=true; wks01 keeps false for nvidia-smi.
  • security.sudo.wheelNeedsPassword=false gives wheel passwordless sudo on nix-l15 only.
  • SSH still allows justin and randoneering; this does not create a randoneering account on nix-l15.

The justin Home Manager profile adds these packages on nix-l15:

  • Stable (nixos-26.05): gnumake, tmux, terraform.
  • Unstable (nixos-unstable): terraform-plugin-docs, golangci-lint.

prowler is not added.

Pi MCP #

Both Pi profiles use pi-mcp-adapter and explicitly disable built-in MCP. home/mcp-servers.nix defines nine shared servers: Context7, Grafana, Kaneo, n8n, NixOS, Obsidian, Open Async, Sentry, and Socket. On nix-l15, both profiles also include Neon database MCP. Activation adds missing Neon inventory and adapter entries without replacing existing user settings. Sign in to Neon through the MCP adapter after rebuilding.

The default Pi profile on nix-l15 also includes pi-jev. SOPS manages its TypeSafe key from secrets/typesafe-ai.yaml; Bash and Fish export the key from its runtime secret path. Other hosts keep their existing Pi packages and MCP inventories. The adapter lists them in /mcp and provides a gateway plus per-server wrappers. Servers connect on demand and keep cached tool listings while idle. The default profile keeps the rpiv-todo extension for /todos.

On the laptops, activation initializes writable mcp.json and mcp-adapter.json files in both ~/.pi/agent/ and ~/.pi/agent-local/. The inventory stays in Pi-compatible mcp.json; OAuth and adapter-only options stay in mcp-adapter.json. Activation preserves existing settings and makes a mode-600 .pre-mcp-adapter backup before correcting incompatible inventory fields. Rebuild and restart Pi after changing the profile packages.

  • Run /mcp or /mcp-adapter to inspect all servers.
  • Run /mcp-auth grafana or /mcp-auth socket to sign in through the adapter.
  • Choose Import sign-in when offered to reuse Grafana's native MCP credentials.
  • Run pi-mcp-adapter doctor --json to check the default profile from the shell.
  • Set PI_CODING_AGENT_DIR="$HOME/.pi/agent-local" when checking the local profile.
  • Run node --test tests/unit/*.test.cjs tests/integration/*.test.cjs to check host registration, Pi profiles, shell exports, and activation.

Pi's shell-level pi mcp commands still use native MCP and do not check adapter OAuth state.

n8n bearer token #

Both profiles connect to https://n8n.randoneering.vip/mcp-server/http as n8n-mcp. Before rebuilding, run sops secrets/justin.yaml and add n8n_mcp_token with the raw token, without the Bearer prefix. Save through SOPS so Git only receives encrypted data. Home Manager decrypts the token into its user secret directory, and Pi reads it at connection time. The token stays out of generated configuration and the Nix store.

Rebuild your host and restart Pi, then run /mcp to check n8n-mcp. Activation adds missing n8n entries to both profiles and preserves existing user overrides.

Flake Structure #

The architecture is designed for clarity and reuse:

.
├── flake.nix
├── flake.lock
├── hosts/              # Defines specific machine instances (e.g., wks, lemur)
│   ├── nix-station/
│   ├── wks/
│   ├── lemur/
│   ├── l15/
│   └── L16/
├── modules/            # Reusable system components (e.g., llm, database)
│   ├── system.nix
│   ├── desktop/
│   ├── networking/
│   ├── llm/
│   └── database/
├── home/               # User-specific configurations (e.g., programs, shell)
│   ├── core.nix
│   ├── programs/
│   ├── shell/
│   ├── languages/
│   ├── secrets.nix
│   └── utils/
├── users/              # User-specific profiles
│   ├── justin/
│   └── randoneering/
└── secrets/            # Encrypted sensitive data
    └── justin.yaml