以安装eza为例
https://blog.youkuaiyun.com/Yqha1/article/details/146040181?spm=1001.2014.3001.5501
nix run github:eza-community/eza
显示
error: experimental Nix feature ‘nix-command’ is disabled; use ‘–extra-experimental-features nix-command’ to override
通过网上的搜索,发现解决方案为
sudo nix --extra-experimental-features 'nix-command flakes' run github:eza-community/eza
进一步可修改配置文件简短命令
Hi, curious if you had Nix installed previously or used the Determinate Systems Installer. The Determinate Systems Installer enables flakes and nix commands by default.
Nix experimental commands are enabled a few different ways:
In your /etc/nix/nix.conf file. Mine has this line (from the Determinate Systems installer):
experimental-features = nix-command flakes
At the command line, as you have done.
nix --extra-experimental-features 'nix-command flakes' run .#apply
I used to include the extra long command as part of the README steps, but after moving to the Determinate Systems installer, I dropped it as I felt the verbosity was a little confusing for newcomers.
But curious how you installed Nix, as I may add it back.
该内容的核心就是通过在/etc/nix/nix.conf
配置文件中加入experimental-features = nix-command flakes
内容
之后就可以使用
sudo nix run github:eza-community/eza
如果要在本机使用,而非使用要使用apt或cargo命令进行安装。