feat(nix): setup shell and env for nix

This commit is contained in:
2023-03-09 23:24:15 +00:00
parent 58f7306c6f
commit 6e3154deba
3 changed files with 28 additions and 0 deletions

21
zsh/nix.zsh Normal file
View 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