Files
nix-config/lib
Ryan Yin cf2435e854 chore(hosts): retire the k3s cluster on the physical hosts
The physical hosts no longer need k3s or KubeVirt: aquamarine runs
natively, the k3s-test masters run as microVMs and kana/ruby under
libvirt. So drop the host cluster and split the shared parts out of the
KubeVirt host module:

- lib/genVmHostModule.nix: the host bits the VMs still need (br0 + the
  physical NIC as a bridge port, KVM, sysctls, earlyoom, libvirt,
  journald, stateVersion)
- the three hosts use it and drop genK3sServerModule; also drop the
  longhorn workarounds (openiscsi + the /usr/local/bin tmpfile) and the
  virtctl package
- remove lib/genKubeVirtHostModule.nix
2026-09-21 16:57:42 +08:00
..
2025-08-21 15:32:50 +08:00

Library

This directory contains helper functions used by flake.nix to reduce code duplication and make it easier to add new machines.

Current Functions

Core System Generators

  1. attrs.nix - Attribute set manipulation utilities
  2. macosSystem.nix - macOS configuration generator for nix-darwin
  3. nixosSystem.nix - NixOS configuration generator
  4. colmenaSystem.nix - Remote deployment configuration for colmena

Specialized Module Generators

  1. genK3sAgentModule.nix - K3s agent node configuration generator
  2. genK3sServerModule.nix - K3s server node configuration generator
  3. genKubeVirtGuestModule.nix - KubeVirt guest VM configuration generator
  4. genKubeVirtHostModule.nix - KubeVirt host configuration generator

Entry Point

  1. default.nix - Main entry point that imports all functions and exports them as a single attribute set

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