This commit is contained in:
John Lancaster
2025-06-30 14:41:13 -05:00
parent 0a660c01df
commit a7a8fe1151

View File

@@ -18,7 +18,7 @@
lib = pkgs.lib; lib = pkgs.lib;
# Define a module that contains the user option # Define a module that contains the user option
userModule = { config, ... }: { optionsModule = { config, ... }: {
options.user = lib.mkOption { options.user = lib.mkOption {
type = lib.types.str; type = lib.types.str;
description = "The username for the Home Manager configuration."; description = "The username for the Home Manager configuration.";
@@ -31,7 +31,7 @@
inherit pkgs; inherit pkgs;
modules = [ modules = [
./home.nix ./home.nix
userModule optionsModule
# Override the user option for this specific configuration # Override the user option for this specific configuration
{ user = username; } { user = username; }
]; ];
@@ -39,7 +39,7 @@
# Default username from the module evaluation # Default username from the module evaluation
moduleEval = lib.evalModules { moduleEval = lib.evalModules {
modules = [ userModule ]; modules = [ optionsModule ];
}; };
defaultUsername = moduleEval.config.user; defaultUsername = moduleEval.config.user;
in in
@@ -57,12 +57,7 @@
homeManagerModules = { homeManagerModules = {
default = ./home.nix; default = ./home.nix;
john-config = ./home.nix; john-config = ./home.nix;
user-module = userModule; options-module = optionsModule;
};
# Export packages if you have any custom ones
packages.${system} = {
# Add any custom packages here
}; };
}; };
} }