# ============================================================================ # 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. { config, lib, inputs, ... }: let # Import all hardware modules so they're available for enabling hwTypes = import ../hw { inherit inputs; }; hwModules = lib.attrValues hwTypes; in { imports = [ ./fs.nix ./boot.nix ./user-config.nix ./fleet-option.nix ../sw inputs.vscode-server.nixosModules.default inputs.nixos-wsl.nixosModules.default ] ++ hwModules; 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. When set, automatically: - Enables the user account (athenix.users..enable = true) - Sets as default WSL user (on WSL systems) The username must exist in athenix.users (defined in users.nix). ''; example = "engr-ugaif"; }; host.useHostPrefix = lib.mkOption { type = lib.types.bool; default = true; description = '' Whether to prepend the hardware type prefix to the hostname. When true: - "nix-laptop" with device "1" → hostname "nix-laptop1" - "nix-wsl" with device "alice" → hostname "nix-wsl-alice" When false: - Device name becomes the full hostname (useful for custom names) ''; }; }; 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" ]; } ]; }