mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 09:26:42 +00:00
feat(nix): setup shell and env for nix
This commit is contained in:
21
zsh/nix.zsh
Normal file
21
zsh/nix.zsh
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#
|
||||||
|
# Nix interative setup
|
||||||
|
#
|
||||||
|
|
||||||
|
sort_nix_paths() {
|
||||||
|
local nix_paths=()
|
||||||
|
|
||||||
|
for p in "${(@)path}"; do
|
||||||
|
if [[ "$p" == "/nix/store/"* ]]; then
|
||||||
|
nix_paths+=("$p")
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for p in "${(@)nix_paths}"; do
|
||||||
|
path_prepend "$p"
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
if command-exists nix-shell; then
|
||||||
|
sort_nix_paths
|
||||||
|
fi
|
||||||
6
zshenv
6
zshenv
@@ -130,6 +130,12 @@ if [ -f "/home/linuxbrew/.linuxbrew/bin/brew" ]; then
|
|||||||
path_prepend "${HOMEBREW_PREFIX}/sbin"
|
path_prepend "${HOMEBREW_PREFIX}/sbin"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Nix
|
||||||
|
if [ -e '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh' ]; then
|
||||||
|
source '/nix/var/nix/profiles/default/etc/profile.d/nix-daemon.sh'
|
||||||
|
# export NIX_PATH="$HOME/.nix-defexpr"
|
||||||
|
fi
|
||||||
|
|
||||||
# Android SDK environment setup.
|
# Android SDK environment setup.
|
||||||
if [ -d "$HOME/Library/Android/sdk" ]; then
|
if [ -d "$HOME/Library/Android/sdk" ]; then
|
||||||
export ANDROID_HOME="$HOME/Library/Android/sdk"
|
export ANDROID_HOME="$HOME/Library/Android/sdk"
|
||||||
|
|||||||
1
zshrc
1
zshrc
@@ -130,6 +130,7 @@ source "$DOTZSH/1password.zsh"
|
|||||||
source "$DOTZSH/emacs.zsh"
|
source "$DOTZSH/emacs.zsh"
|
||||||
source "$DOTZSH/fzf.zsh"
|
source "$DOTZSH/fzf.zsh"
|
||||||
source "$DOTZSH/less.zsh"
|
source "$DOTZSH/less.zsh"
|
||||||
|
source "$DOTZSH/nix.zsh"
|
||||||
source "$DOTZSH/tmux.zsh"
|
source "$DOTZSH/tmux.zsh"
|
||||||
|
|
||||||
# Development
|
# Development
|
||||||
|
|||||||
Reference in New Issue
Block a user