fish: add nix-env plugin
This commit is contained in:
parent
532e9c9793
commit
b6417ac732
@ -1,21 +0,0 @@
|
|||||||
# Nix package manager
|
|
||||||
#
|
|
||||||
# If Nix is installed:
|
|
||||||
# - source the profile with bash
|
|
||||||
# - export the NIX_* variables in fish
|
|
||||||
# - add Nix profile to PATH
|
|
||||||
#
|
|
||||||
# There is no fish profile to source yet.
|
|
||||||
# https://github.com/NixOS/nix/issues/1512
|
|
||||||
if test -f ~/.nix-profile/etc/profile.d/nix.sh
|
|
||||||
for line in (bash -c 'source $0; for name in "${!NIX_@}"; do printf "%s=%s\n" "$name" "${!name}"; done' ~/.nix-profile/etc/profile.d/nix.sh)
|
|
||||||
set -gx (string split -m 1 = $line)
|
|
||||||
end
|
|
||||||
if functions -q fish_add_path
|
|
||||||
fish_add_path -gP ~/.nix-profile/bin
|
|
||||||
else
|
|
||||||
if not contains -- ~/.nix-profile/bin $PATH
|
|
||||||
set PATH ~/.nix-profile/bin $PATH 2>/dev/null
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
@ -2,5 +2,6 @@ jorgebucaran/fisher
|
|||||||
jorgebucaran/replay.fish
|
jorgebucaran/replay.fish
|
||||||
oakninja/MakeMeFish
|
oakninja/MakeMeFish
|
||||||
laughedelic/fish_logo
|
laughedelic/fish_logo
|
||||||
|
lilyball/nix-env.fish
|
||||||
jethrokuan/z
|
jethrokuan/z
|
||||||
reitzig/sdkman-for-fish@v1.4.0
|
reitzig/sdkman-for-fish@v1.4.0
|
||||||
|
@ -3,12 +3,20 @@
|
|||||||
echo "***** INSTALL NIX PACKAGES *****"
|
echo "***** INSTALL NIX PACKAGES *****"
|
||||||
|
|
||||||
ROOTDIR=$(cd "$(dirname "$0")/.." && pwd)
|
ROOTDIR=$(cd "$(dirname "$0")/.." && pwd)
|
||||||
NIX_ENV="$HOME/.nix-profile/bin/nix-env"
|
|
||||||
|
|
||||||
if [ -x "$NIX_ENV" ]; then
|
found_nix_command=0
|
||||||
"$NIX_ENV" --install --remove-all --file "$ROOTDIR/nix/packages.nix"
|
|
||||||
else
|
for profile in "$HOME/.nix-profile" "/nix/var/nix/profiles/default"
|
||||||
echo "Cannot install Nix packages! $NIX_ENV is not executable."
|
do
|
||||||
|
if test -x "$profile/bin/nix-env"; then
|
||||||
|
"$profile/bin/nix-env" --install --remove-all --file "$ROOTDIR/nix/packages.nix"
|
||||||
|
found_nix_command=1
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if test $found_nix_command -ne 1; then
|
||||||
|
echo "Cannot install Nix packages! Command not found: nix-env"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
@ -5,7 +5,7 @@ echo "***** INSTALL NIX *****"
|
|||||||
if [ -d /nix ]; then
|
if [ -d /nix ]; then
|
||||||
echo "Nix is already installed."
|
echo "Nix is already installed."
|
||||||
else
|
else
|
||||||
/bin/bash -c "$(curl -fsSL https://nixos.org/nix/install) --no-daemon"
|
curl -fsSL https://nixos.org/nix/install | sh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
Loading…
x
Reference in New Issue
Block a user