refactor: reorganize directory structure (variants -> hw, glue -> fleet)
- Rename variants/ to hw/ for clearer hardware module naming - Rename glue/ to fleet/ for more intuitive fleet management - Move boot/fs configuration from glue/boot.nix to separate fleet/boot.nix and fleet/fs.nix - Improve separation of concerns between boot, filesystem, and common config
This commit is contained in:
51
fleet/common.nix
Normal file
51
fleet/common.nix
Normal file
@@ -0,0 +1,51 @@
|
||||
# ============================================================================
|
||||
# Common Host Module
|
||||
# ============================================================================
|
||||
# This module contains all the common configuration shared by all host types.
|
||||
# It is automatically imported by the fleet generator for every host.
|
||||
|
||||
{
|
||||
inputs,
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
./fs.nix
|
||||
./boot.nix
|
||||
./user-config.nix
|
||||
../sw
|
||||
../users.nix
|
||||
];
|
||||
|
||||
options.athenix = {
|
||||
forUser = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
description = ''
|
||||
Convenience option to configure a host for a specific user.
|
||||
Automatically enables the user (sets athenix.users.username.enable = true).
|
||||
Value should be a username from athenix.users.accounts.
|
||||
'';
|
||||
};
|
||||
host.useHostPrefix = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Whether to prepend the host prefix to the hostname (used in inventory and hosts/default.nix).";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkMerge [
|
||||
(lib.mkIf (config.athenix.forUser != null) {
|
||||
athenix.users.${config.athenix.forUser}.enable = true;
|
||||
})
|
||||
{
|
||||
system.stateVersion = "25.11";
|
||||
nix.settings.experimental-features = [
|
||||
"nix-command"
|
||||
"flakes"
|
||||
];
|
||||
}
|
||||
];
|
||||
}
|
||||
Reference in New Issue
Block a user