Skip to content

Commit

Permalink
flake.nix: improve HM activation error handling in devShell
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagokokada committed Oct 12, 2023
1 parent c0a3693 commit c8b175b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -215,14 +215,14 @@
export HOME=${homeDirectory}
mkdir -p "$HOME"
${homeManager.activationPackage}/activate
if [[ -L ${profileDirectory}/etc/profile.d/hm-session-vars.sh ]]; then
if ${homeManager.activationPackage}/activate; then
. ${profileDirectory}/etc/profile.d/hm-session-vars.sh
zsh -l && exit 0
else
>&2 echo "[ERROR] Could not source Home Manager!"
>&2 echo "[ERROR] Could not activate Home Manager!"
>&2 echo "[ERROR] Did you pass '--impure' flag to 'nix develop'?"
>&2 echo "[INFO] You can run the following command manually to debug the issue:"
>&2 echo "[INFO] $ ${homeManager.activationPackage}/activate"
fi
'';
};
Expand Down

0 comments on commit c8b175b

Please sign in to comment.