# Helper function to create a NixOS host configuration {inputs, lib}: { system, config, extraModules ? [], }: let pkgs = import inputs.nixpkgs { inherit system; config.allowUnfree = true; }; pkgs-stable = import inputs.nixpkgs-stable { inherit system; config.allowUnfree = true; }; in inputs.nixpkgs.lib.nixosSystem { inherit system; specialArgs = { inherit inputs pkgs-stable; nomarchyConfig = config; }; modules = [ # Core system modules ../modules/core ../modules/desktop ../modules/services ../modules/programs ../modules/performance # Secrets management inputs.agenix.nixosModules.default # Home-manager integration inputs.home-manager.nixosModules.home-manager { home-manager = { useGlobalPkgs = true; useUserPackages = true; extraSpecialArgs = { inherit inputs pkgs-stable; nomarchyConfig = config; }; users.${config.username} = import ../modules/home; }; } # Theme ../themes/theme.nix # Dynamic configuration based on user settings ({...}: { # Networking networking.hostName = config.hostname; # Locale and timezone time.timeZone = config.timezone; i18n.defaultLocale = config.locale; i18n.extraLocaleSettings = let locale = config.locale; in { LC_ADDRESS = locale; LC_IDENTIFICATION = locale; LC_MEASUREMENT = locale; LC_MONETARY = locale; LC_NAME = locale; LC_NUMERIC = locale; LC_PAPER = locale; LC_TELEPHONE = locale; LC_TIME = locale; }; # User account users.users.${config.username} = { isNormalUser = true; description = config.username; extraGroups = ["networkmanager" "wheel" "adbusers" "video" "audio"]; shell = pkgs.zsh; }; # Enable flakes nix.settings.experimental-features = ["nix-command" "flakes"]; # State version system.stateVersion = "24.11"; }) ] ++ extraModules; }