NixOS configuration for a headless dev/ops environment. It supports both the Intel NUC bare-metal host and a lower-cost NixOS-WSL trial host.
flake.nix— flake inputs and host outputshosts/kosmos/— bare-metal NixOS host for the Intel NUChosts/wsl/— NixOS-WSL host configmodules/common/— shared Nix, packages, locale, shell, and tool configmodules/nixos/— bare-metal boot, network, SSH, proxy, firewall, and containersmodules/wsl/— WSL-specific settingsmodules/users/— shared user definitionsttal/,einai/,temenos/— non-secret runtime config deployed by Home Managerscripts/sync-projects— clones or fetches repos listed inttal/projects.tomlpackages/tta-lab/— pinned release packages for tta-lab tools that are not in nixpkgsconfiguration.nix— compatibility entry point for thekosmoshostdisko-config.nix— declarative NVMe partition layout for bare-metal installinstall-guide.md— step-by-step install instructionswsl-guide.md— NixOS-WSL setup notesdocs/k3d-dev-cluster.html— Podman + k3d local cluster setup for WSL
# Syntax check (requires nix)
nix-instantiate --parse configuration.nix
# Build bare-metal host
nix flake check
nix build .#nixosConfigurations.kosmos.config.system.build.toplevel --no-link
# Build WSL host
nix build .#nixosConfigurations.wsl.config.system.build.toplevel --no-linkBoth hosts import modules/common/tunnel-rathole-client.nix, but the service is disabled by default. To enable it:
- Set the real VPS address in
client.remote_addr. - Change
services.rathole.enabletotrue. - Put service tokens in
/var/lib/secrets/rathole/client.toml, not in git.
The initial tunnel maps remote traffic to local SSH on 127.0.0.1:22. Add another service for Matrix/Tuwunel when needed.
services.mihomo is enabled as a systemd service with a non-TUN mixed-port listener at 127.0.0.1:7890. The config is managed via agenix (secrets/mihomo-config.age). The old Windows-host proxy (kosmos-wsl-proxy-env on port 7897) is kept as an opt-in fallback — set kosmos.wsl.windowsProxy.enable = true to use it instead.
WSL installs OpenAI Codex CLI with npm instead of Nixpkgs because Codex releases often and Nixpkgs can lag. Apply the host, then run:
openai-codex-installThis installs @openai/codex@latest into ~/.local/share/npm-global/bin, which Fish adds to PATH.
The WSL host installs pinned release builds for flicknote and the GuionAI fork of taskwarrior. Frequently updated Go CLIs stay outside Nix for now and install from local checkouts into ~/go/bin:
tta-lab-go-installThis starts the tta-lab-go-install.service oneshot user unit. It first runs kosmos-sync-tta-lab-projects, then installs ttal, temenos, diary, organon (og, skill, src, and web), einai, and lenos from ~/code/projects/tta-lab.
The Home Manager user services temenos.service, einai.service, ttal.service, and og.service are defined in modules/common/tta-lab-go.nix. They only start after their binary exists in ~/go/bin.
Proxy is provided by the local mihomo systemd service at 127.0.0.1:7890. Fish and TTAL services use kosmos.wsl.mihomoProxyUrl. The old Windows-host proxy (kosmos-wsl-proxy-env on 7897) is an opt-in fallback via kosmos.wsl.windowsProxy.enable = true.
Code lives under two roots:
~/code/projects/<org>/<repo>for repos we maintain or run from~/code/references/<org>/<repo>for external research clones
After applying the WSL host, clone or fetch the active project set from ttal/projects.toml:
kosmos-sync-projectsUse remote = "https://host/org/repo.git" in ttal/projects.toml when a repo is not on GitHub. Entries without remote default to https://github.com/<org>/<repo>.git.
To sync only the runtime repos needed by tta-lab-go-install:
kosmos-sync-tta-lab-projectsMIT