Skip to content

Instantly share code, notes, and snippets.

@m8rge
Forked from Brandonshire/fish-build-install.sh
Last active February 23, 2024 20:35
Show Gist options
  • Save m8rge/95ab0e397ed34a663274669bd9074a2a to your computer and use it in GitHub Desktop.
Save m8rge/95ab0e397ed34a663274669bd9074a2a to your computer and use it in GitHub Desktop.
Install Fish Shell 3+ on Raspberry Pi using nix-shell
#!/usr/bin/env nix-shell
#! nix-shell -i bash
#! nix-shell -p cmake gettext ncurses5 pcre2
# This script uses [nix-shell package manager](https://nixos.org/download)
# to install fish clearly without any useless packages aftewards
set -e
FISH_VERSION="3.7.0"
cd /tmp
# Create a build directory
mkdir fish-install
cd fish-install
# Download and extract the latest build (could clone from git but that's less stable)
wget https://github.com/fish-shell/fish-shell/releases/download/$FISH_VERSION/fish-$FISH_VERSION.tar.xz
tar -xvf fish-$FISH_VERSION.tar.xz
cd fish-$FISH_VERSION
# Build and install
cmake -DCMAKE_INSTALL_PREFIX=/usr/local .
make
sudo make install
file /usr/local/bin/fish
# Add to shells
echo /usr/local/bin/fish | sudo tee -a /etc/shells
# Set as user's shell
sudo chsh -s /usr/local/bin/fish $(whoami)
# Delete build directory
cd ../../
rm -rf fish-install
@m8rge
Copy link
Author

m8rge commented Feb 23, 2024

  1. install nix-shell sh <(curl -L https://nixos.org/nix/install) --daemon
  2. run script sh <(curl -L https://gist.githubusercontent.com/m8rge/95ab0e397ed34a663274669bd9074a2a/raw/062ea79e2a42afb72f3fb691021a7e947b091e96/fish-build-install.sh)

PS nix-shell video intro https://www.youtube.com/watch?v=0ulldVwZiKA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment