【发布时间】:2018-04-18 17:54:25
【问题描述】:
我想使用来自local nixpkgs repository 的 hubstaff 包,
let
# pass config so that packages use correct allowUnfree for example
nixpkgs-local = import /home/bjorn/projects/nixpkgs { inherit config; };
in
rec {
config.allowUnfree = true;
config.packageOverrides = old: {
# packages from local nixpkgs
inherit (nixpkgs-local) safeeyes hubstaff;
....
但是它的 unfree 包,所以抛出 unfree 包错误
$ sudo nixos-rebuild dry-build
building the system configuration...
error: Package ‘hubstaff-1.3.1-ff75f26’ in /home/bjorn/projects/nixpkgs/pkgs/applications/misc/hubstaff/default.nix:60 has an unfree license (‘unfree’), refusing to evaluate.
据我所知,我需要通过nixpkgs.config.allowUnfree = true,但上面的import /home/bjorn/projects/nixpkgs { inherit config; }; 不起作用
附言
我遇到的另一个问题是我试图查看我在 config.nixpkgs.allowUnfree here 中传递的值
{ config, pkgs, lib, ... }:
let r = {
imports = [
./hardware-configuration.nix
./hardware-configuration-override.nix
./hardware-programs.nix
/home/bjorn/projects/nixpkgs/nixos/modules/services/misc/safeeyes.nix
];
....
};
in
builtins.seq (lib.debug.showVal config.nixpkgs.allowUnfree) r
但我得到infinite recursion error,也许有人知道如何做到这一点?
【问题讨论】: