【发布时间】:2017-11-28 00:49:26
【问题描述】:
我正在尝试使用nix-generate-from-cspan 安装sqitch
来自nix-generate-from-cpan App::Sqitch DBD::Pg,我制作了这个文件:
{buildPerlModule, fetchurl}:
buildPerlModule rec {
name = "App-Sqitch-0.9995";
src = fetchurl {
url = "mirror://cpan/authors/id/D/DW/DWHEELER/${name}.tar.gz";
sha256 = "c29b4610ce43bd43ecfa39188f4cbb00b38c390136fcdd9984142efd99eba292";
};
buildInputs = [ CaptureTiny ModuleBuild TestDeep TestDir TestException TestFile TestFileContents TestMockModule TestNoWarnings ];
propagatedBuildInputs = [ Clone ConfigGitLike DBI DateTime DateTimeTimeZone DevelStackTrace EncodeLocale FileHomeDir HashMerge IOPager IPCRun3 IPCSystemSimple ListMoreUtils Moo PathClass PerlIOutf8_strict StringFormatter StringShellQuote SubExporter TemplateTiny Throwable TryTiny TypeTiny URI URIdb libintlperl namespaceautoclean self."if" ];
meta = {
homepage = http://sqitch.org/;
description = "Sane database change management";
license = stdenv.lib.licenses.mit;
};
}
但运行 nix-build -E 'with import <nixpkgs> { }; callPackage ./sqitch.nix' 会出现此错误:
expression does not evaluate to a derivation (or a set or list of those)
为了调试,我尝试了nix-instantiate --eval --expr 'with import <nixpkgs> { }; callPackage ./sqitch.nix',它给出了:
<LAMBDA>
所以我尝试了nix-build -E 'with import <nixpkgs> { }; callPackage callPackage ./sqitch.nix',但它仍然给出同样的错误,而nix-instantiate --eval --expr 'with import <nixpkgs> { }; callPackage callPackage ./sqitch.nix' 给出:
{ __functor = <CODE>; override = <CODE>; overrideDerivation = <CODE>; }
这对我没有多大帮助。
【问题讨论】:
-
我忘了在
callPackages 之后添加{}。这解释了很多事情