我正在使用默认的nixos 17.09通道,并希望unfree
从不稳定的通道安装软件包。
(import <nixos-unstable> {}).vscode
在这种情况下,我正在使用vscode进行安装,但是出现了必须设置的错误...allowUnfree = true;
。看来该设置仅适用于默认通道。如何allowFree = true;
在不稳定通道上设置?
我找到了解决方案(https://github.com/NixOS/nixpkgs/issues/25880#issuecomment-322855573)。
它使用相同的配置为不稳定通道创建别名。
nixpkgs.config =
{
# Allow proprietary packages
allowUnfree = true;
# Create an alias for the unstable channel
packageOverrides = pkgs:
{
unstable = import <nixos-unstable>
{
# pass the nixpkgs config to the unstable alias
# to ensure `allowUnfree = true;` is propagated:
config = config.nixpkgs.config;
};
};
};
然后你可以使用它像unstable.vscode
代替(import <nixos-unstable> {}).vscode
。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句