working again

This commit is contained in:
John Lancaster
2025-06-30 18:32:35 -05:00
parent a048152eb0
commit 17c69b20fa
2 changed files with 9 additions and 9 deletions

View File

@@ -15,8 +15,7 @@
system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system};
lib = pkgs.lib;
# Defined up separately up here so that it can be evaluated by itself to determine the username
homeManagerModule = { config, pkgs, ... }: {
options.user = lib.mkOption {
type = lib.types.str;
@@ -32,6 +31,12 @@
imports = [ ./home.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;
@@ -41,12 +46,7 @@
homeConfigurations.${userName} = mkHomeConfiguration userName;
# Export the function so other flakes can create configurations for any user
lib.mkHomeConfiguration = username: home-manager.lib.homeManagerConfiguration {
inherit pkgs;
modules = [
homeManagerModule { user = username; }
];
};
lib.mkHomeConfiguration = mkHomeConfiguration;
# Export modules for reuse in other flakes
homeManagerModules.default = homeManagerModule;