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:
5
.github/copilot-instructions.md
vendored
5
.github/copilot-instructions.md
vendored
@@ -26,8 +26,9 @@ This is a **NixOS system configuration repository** that uses:
|
||||
- **`flake.nix`**: Entry point - inputs and outputs only
|
||||
- **`inventory.nix`**: Fleet definitions - host configurations
|
||||
- **`users.nix`**: User account definitions
|
||||
- **`hosts/`**: Host generation logic and hardware types
|
||||
- **`sw/`**: Software configurations organized by system type
|
||||
- **`variants/`**: Hardware type modules (desktop, laptop, surface, lxc, wsl, etc.)
|
||||
- **`glue/`**: Fleet generation logic and common system configuration
|
||||
- **`sw/`**: Software configurations by system type
|
||||
- **`installer/`**: Build artifact generation (ISO, LXC, etc.)
|
||||
- **`templates/`**: Templates for external configurations
|
||||
|
||||
|
||||
25
README.md
25
README.md
@@ -54,18 +54,21 @@ users.nix # User account definitions
|
||||
|
||||
flake.lock # Locked dependency versions
|
||||
|
||||
hosts/ # Host generation logic
|
||||
├── default.nix # Main host generator
|
||||
variants/ # Hardware type modules (exportable as nixosModules)
|
||||
├── 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
|
||||
├── common.nix # Common system configuration
|
||||
├── 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
|
||||
└── user-config.nix # User account and home-manager integration
|
||||
|
||||
sw/ # Software configurations by system type
|
||||
├── default.nix # Software module entry point
|
||||
|
||||
@@ -87,7 +87,7 @@ athenix.users.newuser = {
|
||||
};
|
||||
```
|
||||
|
||||
2. Enable on hosts in `inventory.nix`:
|
||||
2. Enable on fleet in `inventory.nix`:
|
||||
|
||||
```nix
|
||||
nix-laptop = {
|
||||
@@ -294,7 +294,7 @@ For system config:
|
||||
```nix
|
||||
# inventory.nix
|
||||
nix-lxc = {
|
||||
devices."server" = builtins.fetchGit {
|
||||
devices."server".external = builtins.fetchGit {
|
||||
url = "https://git.factory.uga.edu/org/server-config";
|
||||
rev = "abc123...";
|
||||
};
|
||||
|
||||
@@ -28,26 +28,42 @@ External system modules provide host-specific NixOS configurations.
|
||||
|
||||
### Usage
|
||||
|
||||
In `inventory.nix`, reference an external module as a device:
|
||||
In `inventory.nix`, reference an external module using the `external` field:
|
||||
|
||||
```nix
|
||||
nix-lxc = {
|
||||
devices = {
|
||||
# Inline configuration
|
||||
# Inline configuration (traditional method)
|
||||
"local-server" = {
|
||||
athenix.sw.type = "headless";
|
||||
services.nginx.enable = true;
|
||||
};
|
||||
|
||||
# External module
|
||||
"remote-server" = builtins.fetchGit {
|
||||
# External module (lazy evaluation - fetched only when building this host)
|
||||
"remote-server".external = builtins.fetchGit {
|
||||
url = "https://git.factory.uga.edu/org/server-config";
|
||||
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
|
||||
|
||||
```
|
||||
@@ -99,8 +115,8 @@ server-config/
|
||||
|
||||
When a host is built, modules load in this order:
|
||||
|
||||
1. Hardware type module (from `hosts/types/nix-*.nix`)
|
||||
2. Host common configuration (from `hosts/common.nix`)
|
||||
1. Hardware type module (from `variants/nix-*.nix`)
|
||||
2. Common system configuration (from `glue/common.nix`)
|
||||
3. Software type module (from `sw/{type}/`)
|
||||
4. User NixOS modules (from `users.nix` - `nixos.nix` files)
|
||||
5. Device-specific overrides (from `inventory.nix`)
|
||||
|
||||
@@ -123,11 +123,11 @@ nix-surface = {
|
||||
|
||||
### Method 4: External Module
|
||||
|
||||
Reference a Git repository instead of inline configuration:
|
||||
Reference a Git repository using the `external` field (lazy evaluation):
|
||||
|
||||
```nix
|
||||
nix-lxc = {
|
||||
devices."builder" = builtins.fetchGit {
|
||||
devices."builder".external = builtins.fetchGit {
|
||||
url = "https://git.factory.uga.edu/org/builder-config";
|
||||
rev = "abc123...";
|
||||
};
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user