Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

TELEICU/Path B: NixOS: Difference between revisions

From OHC Network Wiki
More languages
Content deleted Content added
Create TELEICU Path B: NixOS guide (via create-page on MediaWiki MCP Server)
 
Fix Mermaid diagrams: remove <pre> wrapping so parser functions execute (via update-page on MediaWiki MCP Server)
 
(2 intermediate revisions by the same user not shown)
Line 12: Line 12:
Every hospital PC runs NixOS with identical, pinned system configuration. A flake repository defines the full OS state — packages, services, users, firewall, K3s agent — and nodes converge to the declared state via <code>comin</code> (pull-based, primary) or <code>deploy-rs</code> (push-based, backup).
Every hospital PC runs NixOS with identical, pinned system configuration. A flake repository defines the full OS state — packages, services, users, firewall, K3s agent — and nodes converge to the declared state via <code>comin</code> (pull-based, primary) or <code>deploy-rs</code> (push-based, backup).


{{#mermaid:flowchart TB
syntaxhighlight lang="text"
subgraph Repo["Flake Repository"]
┌──────────────────────┐
FLAKE["flake.nix<br/>all node configs"]
│ Flake repository │
end
│ (Nix flake, │

│ all node configs) │
subgraph Primary["Primary Path"]
└──────────┬───────────┘
COMIN["comin (pull)<br/>each node polls<br/>for new generation"]
end
├── comin (pull) ──── primary path

│ └─ each node polls for new generation
subgraph Backup["Backup Path"]
└── deploy-rs (push) ── backup path
DEPLOY["deploy-rs (push)<br/>triggered from CI<br/>for urgent deploys"]
end
└─ triggered from CI for urgent deploys

syntaxhighlight
FLAKE --> COMIN
FLAKE --> DEPLOY

COMIN --> N1["Spoke Node<br/>NixOS + K3s agent"]
COMIN --> N2["Hub Node<br/>NixOS + K3s agent"]
COMIN --> NM["... (200 more)"]

DEPLOY --> N1
DEPLOY --> N2
}}


== Provisioning (zero-touch) ==
== Provisioning (zero-touch) ==
Line 85: Line 95:
== Repository structure ==
== Repository structure ==


{{#mermaid:flowchart LR
syntaxhighlight lang="text"
teleicu-nixos/
subgraph Flake["teleicu-nixos/"]
FLAKE_NIX["flake.nix<br/>flake.lock"]
├── flake.nix # inputs + outputs
HOSTS["hosts/<br/>cp-1/<br/>cp-2/<br/>cp-3/<br/>spoke-template/<br/>hub-template/"]
├── flake.lock
MODULES["modules/<br/>tailscale.nix<br/>k3s-agent.nix<br/>cloudflared.nix<br/>zfs.nix<br/>openebs.nix<br/>monitoring.nix<br/>downtime-classifier.nix"]
├── hosts/
PROFILES["profiles/<br/>base.nix<br/>spoke.nix<br/>hub.nix"]
│ ├── cp-1/ # control plane VM 1
SECRETS["secrets/"]
│ │ ├── configuration.nix
└── hardware-configuration.nix
ISO["iso/<br/>bootstrap.nix"]
COMIN_CFG["comin/<br/>configuration.nix"]
│ ├── cp-2/
end
│ ├── cp-3/
}}
│ ├── spoke-template/ # template for spoke nodes
│ │ ├── configuration.nix
│ │ └── hardware-configuration.nix
│ └── hub-template/ # template for hub nodes
├── modules/
│ ├── tailscale.nix
│ ├── k3s-agent.nix
│ ├── cloudflared.nix
│ ├── zfs.nix
│ ├── openebs.nix
│ ├── monitoring.nix
│ └── downtime-classifier.nix
├── profiles/
│ ├── base.nix # shared across all nodes
│ ├── spoke.nix # spoke-specific additions
│ └── hub.nix # hub-specific additions
├── secrets/ # encrypted via sops-nix
│ └── …
├── iso/
│ └── bootstrap.nix # nixos-generator config for install ISO
└── comin/
└── configuration.nix # comin poll config
syntaxhighlight


== Flake structure ==
== Flake structure ==
Line 127: Line 115:
- <code>packages</code> for the bootstrap ISO
- <code>packages</code> for the bootstrap ISO
- <code>devShells</code> for development tooling
- <code>devShells</code> for development tooling

{{Navbox TELEICU}}


{{Related}}
{{Related}}