From 17c69b20faad15fc4a485ecf5637841b0c84bdf7 Mon Sep 17 00:00:00 2001 From: John Lancaster <32917998+jsl12@users.noreply.github.com> Date: Mon, 30 Jun 2025 18:32:35 -0500 Subject: [PATCH] working again --- flake.nix | 16 ++++++++-------- home.nix | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index 7d22aeb..f6a66e2 100644 --- a/flake.nix +++ b/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; diff --git a/home.nix b/home.nix index 8d6dec0..05eacf5 100644 --- a/home.nix +++ b/home.nix @@ -81,5 +81,5 @@ # Let Home Manager install and manage itself. programs.home-manager.enable = true; - programs.ssh.enable = true; + # programs.ssh.enable = true; }