This is my interpretation of the perfect nix flake, this powers my desktops, laptops, servers, vms, containers, and all aspects of my computers.
- Automated Discovery: Hosts and users are automatically configured from filesystem structure
- Automated Persistence: TempFS with persistable components using Impermanence or BTRFS snapshotting
- Secret Management: Encrypted secrets in NixOS (sops-nix) and home-manager (sops-nix with sops)
- Automated Updates: Flake dependency updates through Github Actions using Update-flake-lock
- Hardware Acceleration: Automatic hardware acceleration support detection and configuration
- Modular Architecture: Custom modules and overlays for extensibility
- NixOS-managed systems with automatic configuration discovery:
- Desktops - Personal workstations and development environments
- Servers - Infrastructure services and automation
- Laptops - Portable systems with power management
The repository uses an automatic discovery system that scans the filesystem to build configurations:
.
├─ home # Root for all user homes (auto-discovered)
│ ├─── {username} # User-specific configurations
│ └─── shared # Shared home-manager modules
├─ hosts # Root for all hosts (auto-discovered by device type)
│ ├─── shared # Auto-imported modules for all hosts
│ │ ├─── global # Core system configuration (locale, networking, etc.)
│ │ └─── optional# Optional modules for specific use cases
│ ├─── desktop # Desktop NixOS systems
│ │ ├─── shared # Auto-imported modules for desktops
│ │ ├─── {host} # Individual desktop host configurations
│ ├─── laptop # Laptop NixOS Systems
│ │ ├─── shared # Auto-imported modules for laptops
│ │ └─── {host} # Individual laptop host configurations
│ └─── server # Server NixOS Systems
│ ├─── shared # Auto-imported modules for servers
│ └─── {host} # Individual server host configurations
├─ lib # Extensions to nixpkgs lib and custom builders
│ └─── builders # System and home-manager configuration builders
├─ modules # Custom NixOS and home-manager modules
├─ overlays # NixPkgs overlays for package modifications
├─ pkgs # Custom packages not in nixpkgs
└─ docs # Additional documentation
The flake automatically discovers:
- Hosts: By scanning
hosts/{device-type}/
directories (excludingshared/
) - Users: By scanning
home/
directories and matching with existing hosts - Hardware Acceleration: Support based on predefined host lists
- Creating New Hosts - Step-by-step guide to add new hosts to your configuration
- Creating New Users - Instructions for adding new user configurations
- Installation Guide - Complete installation and setup instructions
These probably won't happen honestly
- Cosmic Desktop once stabilized
- Declarative disk management with disko for all hosts
- Automated backup strategies for persistent data
This repository includes utilities for development and debugging:
utils/get-os-imports.nix
- Debug NixOS module importsutils/get-hm-imports.nix
- Debug home-manager importsutils/get-imports.nu
- Nushell script for import analysis