refactor: create glue/ and variants/ directories

- Add glue/ for fleet generation logic and common configuration
- Add variants/ for hardware type modules
- Improves separation of concerns and module organization
This commit is contained in:
UGA Innovation Factory
2026-01-06 18:31:40 -05:00
parent 03f532e867
commit cb37fad70e
12 changed files with 1234 additions and 0 deletions

29
variants/default.nix Normal file
View File

@@ -0,0 +1,29 @@
# ============================================================================
# Host Types Module
# ============================================================================
# This module exports all available host types as an attribute set.
# Each type is a NixOS module function that takes { inputs } and returns
# a module configuration.
{ inputs }:
let
inherit (builtins) readDir attrNames;
lib = inputs.nixpkgs.lib;
inherit (lib) filterAttrs removeSuffix genAttrs;
files = readDir ./.;
# Keep only regular *.nix files except default.nix
nixFiles =
filterAttrs
(name: type:
type == "regular"
&& lib.hasSuffix ".nix" name
&& name != "default.nix")
files;
moduleNames = map (name: removeSuffix ".nix" name) (attrNames nixFiles);
in
genAttrs moduleNames
(name:
import ./${name}.nix { inherit inputs; })