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:
@@ -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...";
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user