Files
nix-config-ryan4yin/lib
ryan4yin | 二花 90bbe8bc4f fix(monitoring): stop recurring false alerts (#395)
The Telegram channel was dominated by alerts that can never be actionable:

- DriveTemperatureHigh/Critical did not filter temperature_type, so
  max(smartctl_device_temperature) picked the drive's rated
  op_limit_max/critical_limit_max instead of the actual reading. ai reported
  95 C and youko 130 C while the drives actually ran at 40-48 C.
- HostPhysicalComponentTooHot excluded label!="tctl", but the AMD k10temp
  hwmon sensor labels itself Tctl, so the CPU control temperature (up to
  ~100 C under load) tripped the alert on every AMD host.
- MicroVM guests share the host's read-only /nix/store, so their
  nix-gc.service always failed and tripped HostSystemdServiceCrashed on all
  six k3s guests. Disable automatic GC in the guest; the host's nix.gc
  reclaims the shared store.

The remaining k3s alert noise comes from workloads running on the masters
that belong on the workers; that is fixed in k8s-gitops, not by resizing
the control-plane VMs.
2026-10-07 12:51:30 +08:00
..

Library

This directory contains helper functions used by outputs/default.nix (and the installer flake) to reduce code duplication and make it easier to add new machines.

Current Functions

Core System Generators

  1. macosSystem.nix - macOS configuration generator for nix-darwin
  2. nixosSystem.nix - NixOS configuration generator
  3. colmenaSystem.nix - Remote deployment configuration for colmena

Specialized Module Generators

  1. genK3sServerModule.nix - K3s server node configuration generator
  2. genK3sAgentModule.nix - K3s agent/worker node configuration generator
  3. genVmHostModule.nix - physical VM host (bridge + libvirt) configuration generator
  4. genMicrovmGuestModule.nix - NixOS microVM guest configuration generator
  5. genLibvirtDomainXml.nix - libvirt domain XML generator (imported directly by host configs)

Entry Point

  1. default.nix - Main entry point that imports the generators and exports them as a single attribute set, plus the relativeToRoot and scanPaths helpers

Usage

These functions are designed to:

  • Generate consistent configurations across different architectures
  • Provide type-safe configuration for complex systems
  • Enable easy scaling of the infrastructure
  • Support both local development and production deployments

Architecture Support

  • x86_64-linux: Primary desktop systems
  • aarch64-linux: ARM64 Linux systems (Apple Silicon, SBCs)
  • aarch64-darwin: Apple Silicon macOS systems