Warning
This repository is not expected to deploy or run correctly as-is in a public
checkout. It depends on an internal private/ submodule and site-specific
inventory, so it should be treated as a reference repository rather than a
directly usable deployment target.
This repository is a personal NixOS infrastructure tree.
It covers several different kinds of machines at once:
- a primary desktop
- a home router and edge node
- public VPS nodes
- self-hosted applications and platform services
- custom Nix packages and NixOS modules
It is not written as a generic starter template. It is a working repository with personal assumptions, but it is organized so those assumptions remain readable.
The shortest path to understanding the repo is:
outputs.nixmodules/flake/osConfig.nixmodules/lib/mkOS.nix- the relevant module under
modules/
That path shows how the flake entrypoint becomes concrete machine configurations.
modules/flakecontains flake wiring, host declarations, and top-level checks.modules/libcontains small composition helpers and constructors.modules/substratecontains shared base assumptions used across multiple machines.modules/presetscontains role bundles such as desktop or server.modules/profilescontains concrete machine definitions and node-specific values.modules/servicescontains service modules and repository-local service wrappers.modules/applicationscontains application-facing features.modules/pkgscontains custom package definitions.privatecontains private inventory layered into the public tree.
The repository is intended to be feature-first rather than host-first. Host profiles are where machines choose features and provide concrete values, not where the whole system is reimplemented from scratch.
mainis the primary desktop and workstation.routeris the home edge machine and also hosts several local platform services.aliyunis a public control-plane VPS.greencloudis a public content or application VPS.
The exact workloads can evolve, but the split between desktop, edge, and public nodes is one of the main structural ideas in the repo.
At a high level, the composition flow is:
- flake entrypoints and host declarations
- shared substrate
- role presets
- feature and service modules
- concrete host profiles
This is why the repository tree matters so much: directory names are part of the architecture, not just storage.
This repository uses two service namespaces on purpose:
services.*is the real runtime service surface, usually native or upstream NixOS module options.local.services.*is for repository-local wrappers, orchestration layers, and instance wiring around those services.
A repository-local wrapper may still write into services.* internally, but
its public interface lives under local.services.* so the deployment surface
and the repository's own orchestration layer stay distinguishable.
Profiles are the place for concrete machine identity and values, such as:
- hardware and storage configuration
- addresses and network identity
- domains and host bindings
- secrets and host-local references
- per-node service instance values
If a behavior is reused across machines, it usually belongs back in a module.