Created
May 14, 2017 15:22
-
-
Save czyzykowski/7327df8eeb188a989a164aa6e46cd133 to your computer and use it in GitHub Desktop.
Translation of the latest (2017-05-14) nix.sh to fish
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if test -n $HOME | |
set NIX_LINK $HOME/.nix-profile | |
# Set the default profile. | |
if test ! -L "$NIX_LINK" | |
echo "creating $NIX_LINK" >&2 | |
set _NIX_DEF_LINK /nix/var/nix/profiles/default | |
ln -s "$_NIX_DEF_LINK" "$NIX_LINK" | |
end | |
set -x PATH $PATH $NIX_LINK/bin | |
set -x PATH $PATH $NIX_LINK/sbin | |
# Subscribe the user to the Nixpkgs channel by default. | |
if test ! -e $HOME/.nix-channels | |
echo "https://nixos.org/channels/nixpkgs-unstable nixpkgs" > $HOME/.nix-channels | |
end | |
# Append ~/.nix-defexpr/channels/nixpkgs to $NIX_PATH so that | |
# <nixpkgs> paths work when the user has fetched the Nixpkgs | |
# channel. | |
set -x NIX_PATH nixpkgs=$HOME/.nix-defexpr/channels/nixpkgs | |
# Set $NIX_SSL_CERT_FILE so that Nixpkgs applications like curl work. | |
if test -e /etc/ssl/certs/ca-certificates.crt # NixOS, Ubuntu, Debian, Gentoo, Arch | |
set -x NIX_SSL_CERT_FILE /etc/ssl/certs/ca-certificates.crt | |
else if test -e /etc/ssl/ca-bundle.pem # openSUSE Tumbleweed | |
set -x NIX_SSL_CERT_FILE /etc/ssl/ca-bundle.pem | |
else if test -e /etc/ssl/certs/ca-bundle.crt # Old NixOS | |
set -x NIX_SSL_CERT_FILE /etc/ssl/certs/ca-bundle.crt | |
else if test -e /etc/pki/tls/certs/ca-bundle.crt # Fedora, CentOS | |
set -x NIX_SSL_CERT_FILE /etc/pki/tls/certs/ca-bundle.crt | |
else if test -e "$NIX_LINK/etc/ssl/certs/ca-bundle.crt" # fall back to cacert in Nix profile | |
set -x NIX_SSL_CERT_FILE "$NIX_LINK/etc/ssl/certs/ca-bundle.crt" | |
else if test -e "$NIX_LINK/etc/ca-bundle.crt" # old cacert in Nix profile | |
set -x NIX_SSL_CERT_FILE "$NIX_LINK/etc/ca-bundle.crt" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment