config/install/install-nix-packages.sh

23 lines
473 B
Bash
Executable File

#!/bin/bash
echo "***** INSTALL NIX PACKAGES *****"
ROOTDIR=$(cd "$(dirname "$0")/.." && pwd)
found_nix_command=0
for profile in "$HOME/.nix-profile" "/nix/var/nix/profiles/default"
do
if test -x "$profile/bin/nix-env"; then
"$profile/bin/nix-env" --install --remove-all --file "$ROOTDIR/.config/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
echo