nix的使用

以安装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命令进行安装。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值