docs: update all references from hosts/ to glue/ and variants/

- Update README.md structure section
- Update DEVELOPMENT.md, EXTERNAL_MODULES.md, INVENTORY.md
- Update GitHub Copilot instructions
- Update PROXMOX_LXC.md references
- Clarify new directory organization and purpose
This commit is contained in:
UGA Innovation Factory
2026-01-06 18:32:18 -05:00
parent faf7bb635e
commit 6972a999ca
6 changed files with 44 additions and 24 deletions

View File

@@ -26,8 +26,9 @@ This is a **NixOS system configuration repository** that uses:
- **`flake.nix`**: Entry point - inputs and outputs only - **`flake.nix`**: Entry point - inputs and outputs only
- **`inventory.nix`**: Fleet definitions - host configurations - **`inventory.nix`**: Fleet definitions - host configurations
- **`users.nix`**: User account definitions - **`users.nix`**: User account definitions
- **`hosts/`**: Host generation logic and hardware types - **`variants/`**: Hardware type modules (desktop, laptop, surface, lxc, wsl, etc.)
- **`sw/`**: Software configurations organized by system type - **`glue/`**: Fleet generation logic and common system configuration
- **`sw/`**: Software configurations by system type
- **`installer/`**: Build artifact generation (ISO, LXC, etc.) - **`installer/`**: Build artifact generation (ISO, LXC, etc.)
- **`templates/`**: Templates for external configurations - **`templates/`**: Templates for external configurations

View File

@@ -54,18 +54,21 @@ users.nix # User account definitions
flake.lock # Locked dependency versions flake.lock # Locked dependency versions
hosts/ # Host generation logic variants/ # Hardware type modules (exportable as nixosModules)
├── default.nix # Main host generator ├── default.nix # Auto-exports all variant types
├── nix-desktop.nix # Desktop workstations
├── nix-laptop.nix # Laptop systems
├── nix-surface.nix # Surface Pro tablets
├── nix-lxc.nix # LXC containers
├── nix-wsl.nix # WSL instances
├── nix-zima.nix # ZimaBoard systems
└── nix-ephemeral.nix # Diskless/netboot systems
glue/ # Fleet generation and common configuration
├── fleet.nix # Processes inventory.nix to generate all hosts
├── common.nix # Common NixOS configuration (all hosts)
├── boot.nix # Boot and filesystem configuration ├── boot.nix # Boot and filesystem configuration
── common.nix # Common system configuration ── user-config.nix # User account and home-manager integration
├── user-config.nix # User configuration integration
└── types/ # Hardware type modules
├── nix-desktop.nix
├── nix-laptop.nix
├── nix-surface.nix
├── nix-lxc.nix
├── nix-wsl.nix
└── nix-ephemeral.nix
sw/ # Software configurations by system type sw/ # Software configurations by system type
├── default.nix # Software module entry point ├── default.nix # Software module entry point

View File

@@ -87,7 +87,7 @@ athenix.users.newuser = {
}; };
``` ```
2. Enable on hosts in `inventory.nix`: 2. Enable on fleet in `inventory.nix`:
```nix ```nix
nix-laptop = { nix-laptop = {
@@ -294,7 +294,7 @@ For system config:
```nix ```nix
# inventory.nix # inventory.nix
nix-lxc = { nix-lxc = {
devices."server" = builtins.fetchGit { devices."server".external = builtins.fetchGit {
url = "https://git.factory.uga.edu/org/server-config"; url = "https://git.factory.uga.edu/org/server-config";
rev = "abc123..."; rev = "abc123...";
}; };

View File

@@ -28,26 +28,42 @@ External system modules provide host-specific NixOS configurations.
### Usage ### Usage
In `inventory.nix`, reference an external module as a device: In `inventory.nix`, reference an external module using the `external` field:
```nix ```nix
nix-lxc = { nix-lxc = {
devices = { devices = {
# Inline configuration # Inline configuration (traditional method)
"local-server" = { "local-server" = {
athenix.sw.type = "headless"; athenix.sw.type = "headless";
services.nginx.enable = true; services.nginx.enable = true;
}; };
# External module # External module (lazy evaluation - fetched only when building this host)
"remote-server" = builtins.fetchGit { "remote-server".external = builtins.fetchGit {
url = "https://git.factory.uga.edu/org/server-config"; url = "https://git.factory.uga.edu/org/server-config";
rev = "abc123def456..."; # Must pin to specific commit rev = "abc123def456..."; # Must pin to specific commit
}; };
# External module with additional local config
"mixed-server" = {
external = builtins.fetchGit {
url = "https://git.factory.uga.edu/org/server-config";
rev = "abc123def456...";
};
# Additional local overrides
athenix.users.admin.enable = true;
services.openssh.permitRootLogin = "no";
};
}; };
}; };
``` ```
**Key Features:**
- **Lazy Evaluation**: External modules are only fetched when building the specific host
- **Efficient Rebuilds**: Other hosts can be rebuilt without fetching unrelated external modules
- **Submodule Support**: Works with Git submodules without affecting other hosts
### Repository Structure ### Repository Structure
``` ```
@@ -99,8 +115,8 @@ server-config/
When a host is built, modules load in this order: When a host is built, modules load in this order:
1. Hardware type module (from `hosts/types/nix-*.nix`) 1. Hardware type module (from `variants/nix-*.nix`)
2. Host common configuration (from `hosts/common.nix`) 2. Common system configuration (from `glue/common.nix`)
3. Software type module (from `sw/{type}/`) 3. Software type module (from `sw/{type}/`)
4. User NixOS modules (from `users.nix` - `nixos.nix` files) 4. User NixOS modules (from `users.nix` - `nixos.nix` files)
5. Device-specific overrides (from `inventory.nix`) 5. Device-specific overrides (from `inventory.nix`)

View File

@@ -123,11 +123,11 @@ nix-surface = {
### Method 4: External Module ### Method 4: External Module
Reference a Git repository instead of inline configuration: Reference a Git repository using the `external` field (lazy evaluation):
```nix ```nix
nix-lxc = { nix-lxc = {
devices."builder" = builtins.fetchGit { devices."builder".external = builtins.fetchGit {
url = "https://git.factory.uga.edu/org/builder-config"; url = "https://git.factory.uga.edu/org/builder-config";
rev = "abc123..."; rev = "abc123...";
}; };

View File

@@ -46,7 +46,7 @@ Add the host to `inventory.nix` with the `nix-lxc` type or ensure it has the app
} }
``` ```
Your host type configuration (`hosts/types/nix-lxc.nix`) should include: Your host type configuration (`variants/nix-lxc.nix`) should include:
```nix ```nix
{ {