From 08710dd95d8faf14ef69c48ad2c1ce007f8dd9d8 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Fri, 17 May 2024 13:15:48 +0200 Subject: Check for nix environment installed via nix profile, if there isn't a system one --- zsh/default.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'zsh') diff --git a/zsh/default.nix b/zsh/default.nix index b89dea7..a2073e7 100644 --- a/zsh/default.nix +++ b/zsh/default.nix @@ -7,8 +7,13 @@ zshrc = pkgs.writeTextDir ".zshrc" '' # Import before anything else, so that we have the full PATH available for - # everything following - . /etc/profile.d/nix-daemon.sh + # everything following. We prefer a global install (via the system's actual + # package manager) to using nix in the nix profile. + if [ -f /etc/profile.d/nix-daemon.sh ]; then + . /etc/profile.d/nix-daemon.sh + elif [ -f "$HOME"/.nix-profile/etc/profile.d/nix-daemon.sh ]; then + . "$HOME"/.nix-profile/etc/profile.d/nix-daemon.sh + fi # oh-my-zsh export ZSH=${pkgs.oh-my-zsh}/share/oh-my-zsh -- cgit v1.2.3