updates
This commit is contained in:
43
flake.nix
43
flake.nix
@@ -26,26 +26,43 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
# Evaluate the module to get the config
|
# Function to create a home configuration for any user
|
||||||
|
mkHomeConfiguration = username: home-manager.lib.homeManagerConfiguration {
|
||||||
|
inherit pkgs;
|
||||||
|
modules = [
|
||||||
|
./home.nix
|
||||||
|
userModule
|
||||||
|
# Override the user option for this specific configuration
|
||||||
|
{ user = username; }
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Default username from the module evaluation
|
||||||
moduleEval = lib.evalModules {
|
moduleEval = lib.evalModules {
|
||||||
modules = [ userModule ];
|
modules = [ userModule ];
|
||||||
};
|
};
|
||||||
|
defaultUsername = moduleEval.config.user;
|
||||||
username = moduleEval.config.user;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
homeConfigurations.${username} = home-manager.lib.homeManagerConfiguration {
|
# Default configuration using the default username
|
||||||
inherit pkgs;
|
homeConfigurations.${defaultUsername} = mkHomeConfiguration defaultUsername;
|
||||||
|
|
||||||
# Specify your home configuration modules here, for example,
|
# Export the function so other flakes can create configurations for any user
|
||||||
# the path to your home.nix.
|
lib = {
|
||||||
modules = [
|
mkHomeConfiguration = mkHomeConfiguration;
|
||||||
./home.nix
|
mkHomeConfigurationForUser = username: mkHomeConfiguration username;
|
||||||
userModule # Include the user module in Home Manager modules too
|
};
|
||||||
];
|
|
||||||
|
|
||||||
# Optionally use extraSpecialArgs
|
# Export modules for reuse in other flakes
|
||||||
# to pass through arguments to home.nix
|
homeManagerModules = {
|
||||||
|
default = ./home.nix;
|
||||||
|
john-config = ./home.nix;
|
||||||
|
user-module = userModule;
|
||||||
|
};
|
||||||
|
|
||||||
|
# Export packages if you have any custom ones
|
||||||
|
packages.${system} = {
|
||||||
|
# Add any custom packages here
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
4
home.nix
4
home.nix
@@ -3,8 +3,8 @@
|
|||||||
{
|
{
|
||||||
# Home Manager needs a bit of information about you and the paths it should
|
# Home Manager needs a bit of information about you and the paths it should
|
||||||
# manage.
|
# manage.
|
||||||
home.username = "john";
|
home.username = config.user;
|
||||||
home.homeDirectory = "/home/john";
|
home.homeDirectory = "/home/${config.user}";
|
||||||
|
|
||||||
# This value determines the Home Manager release that your configuration is
|
# This value determines the Home Manager release that your configuration is
|
||||||
# compatible with. This helps avoid breakage when a new Home Manager release
|
# compatible with. This helps avoid breakage when a new Home Manager release
|
||||||
|
|||||||
Reference in New Issue
Block a user