使用国内镜像下载安装
sh <(curl -L https://mirrors.tuna.tsinghua.edu.cn/nix/latest/install)
使用fish-shell激活
nix.fish脚本内一些特性在部分shell内不支持, 会报错
unexpected token `--argument-names'
这个是fish-shell的函数选项 function - create a function — fish-shell 4.6.0 documentation
可以
# 安装fish-shell
sudo apt install fish -y
# 进入fish环境
fish
# 运行脚本
. ~/.nix-profile/etc/profile.d/nix.fish
之后就可以使用nix命令了