diff --git a/flake.nix b/flake.nix index f55fdd7e..26f5da3b 100644 --- a/flake.nix +++ b/flake.nix @@ -197,8 +197,9 @@ homeManager = (mkHomeConfig { inherit system; hostname = "devShell"; - homePath = "/tmp"; - username = "home"; + homeDirectory = "/tmp/home"; + # Needs to run with `--impure` flag + username = builtins.getEnv "USER"; extraModules = [{ home.stateVersion = "23.11"; # Disable some modules @@ -232,10 +233,6 @@ { devShells.default = pkgs.mkShell { shellHook = '' - # Home Manager checks if the USER environment variable matches - # username - OLD_USER="$USER" - export USER=${homeManager.config.home.username} export HOME=${homeManager.config.home.homeDirectory} mkdir -p "$HOME" @@ -243,9 +240,6 @@ ${homeManager.activationPackage}/activate - export USER="$OLD_USER" - unset OLD_USER - zsh -l && exit 0 ''; }; diff --git a/lib/flake.nix b/lib/flake.nix index ef7c6086..fa4612be 100644 --- a/lib/flake.nix +++ b/lib/flake.nix @@ -86,6 +86,7 @@ in { hostname , username ? "thiagoko" , homePath ? "/home" + , homeDirectory ? "${homePath}/${username}" , configPosfix ? "Projects/nix-configs" , configuration ? ../home-manager , deviceType ? "desktop" @@ -95,7 +96,6 @@ in }: let pkgs = nixpkgs.legacyPackages.${system}; - homeDirectory = "${homePath}/${username}"; in { homeConfigurations.${hostname} = homeManagerConfiguration {