stripped down

This commit is contained in:
John Lancaster
2025-06-30 19:21:35 -05:00
parent 17c69b20fa
commit bb145deb8e
2 changed files with 13 additions and 23 deletions

View File

@@ -15,8 +15,9 @@
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
lib = pkgs.lib;
homeManagerModule = { config, pkgs, ... }: {
in
{
homeManagerModules.default = { config, pkgs, ... }: {
options.user = lib.mkOption {
type = lib.types.str;
description = "The username for the Home Manager configuration.";
@@ -28,27 +29,7 @@
description = "Profile type for the Home Manager configuration.";
};
imports = [ ./home.nix ];
imports = [ ./home.nix ] ++ lib.optionals (config.profile == "personal") [ ./git-personal.nix ];
};
# Function to create a home configuration for any user
mkHomeConfiguration = username: home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [ homeManagerModule { user = username; } ];
};
# Default username from the module evaluation
evaluatedOptions = lib.evalModules { modules = [ homeManagerModule ]; };
userName = evaluatedOptions.config.user;
in
{
# Default configuration using the default username
homeConfigurations.${userName} = mkHomeConfiguration userName;
# Export the function so other flakes can create configurations for any user
lib.mkHomeConfiguration = mkHomeConfiguration;
# Export modules for reuse in other flakes
homeManagerModules.default = homeManagerModule;
};
}