working again
This commit is contained in:
16
flake.nix
16
flake.nix
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user