NixOS Homelab
Infrastructure
A 4-host Kubernetes cluster with GPU compute, distributed storage, and GPU-accelerated AI inference workloads.
Infrastructure Meets Cloud Native
The Challenge
The Solution
Infrastructure Innovation
NFS Config Sync
Profile System
Custom NixOS Modules
Operations & Automation
Automated Deployments
Service Mesh
Observability
Cluster Capabilities
Hardware Infrastructure
AI/ML Services
GPU Compute
GPUs: NVIDIA (8GB) - available<br>NVIDIA (8GB) - available<br>NVIDIA (8GB) - available<br>NVIDIA (24GB) - available<br>NVIDIA (8GB) - available
Storage: HDD, NVMe
Ready for: AI inference workloads
Infrastructure Timeline
The Journey
Windows + Proxmox
Dual-boot setup with Proxmox servers for testing, Windows as daily driver
Killed Windows
Full commitment to Linux. Started distro hopping journey.
OS Evolution
Omarchy (Arch-based) → CachyOS (optimized Arch) → NixOS (declarative + reproducible)
NixOS Initial Commit
First NixOS configuration. Single host with basic desktop + gaming
AI Gateway v1.0
OpenAI-compatible API, multi-GPU support
Gateway v2.0
Middleware architecture with circuit breaker, rate limiting, Redis caching
Cluster Expansion
Added 3 more nodes. Implemented NFS config sync, profile system, 50+ Justfile commands
K8s Phase 1-3: Foundation
Control plane, Flannel CNI, CoreDNS, stateful services (GlitchTip PostgreSQL)
K8s Phase 4-5: Services & GPU
Stateless services (GlitchTip web/worker, SearXNG, n8n), GPU workloads (llama.cpp)
K8s Phase 6-7: Monitoring & GPU
Prometheus + Grafana monitoring, GPU compute workloads with 5 GPUs ready
Production Cluster Live
60+ pods running across 4 hosts. AI inference, monitoring, and GPU compute fully operational
Code Explorer
Code Patterns
# NixOS Configuration Pattern
{
# Declarative system configuration
boot.loader.systemd-boot.enable = true;
# Network setup
networking.networkmanager.enable = true;
# User management
users.users.jkro = {
isNormalUser = true;
extraGroups = [ "wheel" "networkmanager" ];
};
# System packages
environment.systemPackages = with pkgs; [
vim git curl wget
];
}# Module Composition Pattern
{ config, pkgs, ... }:
{
imports = [
./hardware-configuration.nix
./modules/gpu.nix
./modules/networking.nix
];
# Service configuration with options
services.nginx = {
enable = true;
virtualHosts."example.com" = {
forceSSL = true;
enableACME = true;
root = "/var/www/example";
};
};
# GPU passthrough for ML workloads
hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.beta;
}# Advanced NixOS Patterns
{ config, pkgs, lib, ... }:
{
# Service configuration with systemd
systemd.services.myservice = {
description = "Custom Service";
wantedBy = [ "multi-user.target" ];
serviceConfig = {
ExecStart = "/usr/bin/myservice";
Restart = "on-failure";
};
};
# System activation scripts
system.activationScripts.setup-dirs.text = ''
mkdir -p /var/lib/myservice
chown myservice:myservice /var/lib/myservice
'';
}