【发布时间】:2019-10-18 05:44:46
【问题描述】:
基本上我正在使用这个:
default.nix
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc864" }:
nixpkgs.pkgs.haskell.packages.${compiler}.callPackage ./gitchapter.nix { }
gitchapter.nix
{ mkDerivation, base, directory, extra, filepath, foldl, hpack
, HUnit, mtl, optparse-applicative, pandoc-include-code, parsec
, pretty-simple, process, QuickCheck, rainbow, regex-pcre
, regex-posix, safe, stdenv, string-conversions, system-filepath
, template-haskell, text, transformers, turtle, unix
, unordered-containers
}:
mkDerivation {
pname = "gitchapter";
version = "0.1.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
libraryToolDepends = [ hpack ];
executableHaskellDepends = [
base directory extra filepath foldl HUnit mtl optparse-applicative
pandoc-include-code parsec pretty-simple process QuickCheck rainbow
regex-pcre regex-posix safe string-conversions system-filepath
template-haskell text transformers turtle unix unordered-containers
];
preConfigure = "hpack";
license = stdenv.lib.licenses.bsd3;
}
但是,pandoc-include-code 构建失败存在一个问题,该问题似乎已在 git 存储库中得到修复。如何覆盖包以指向 git 存储库或本地目录?
我会按照https://nixos.org/nixos/nix-pills/nixpkgs-overriding-packages.html 的说明进行操作,还是会因为使用nixpkgs.pkgs.haskell.packages.${compiler}.callPackage 函数而有所不同?
编辑: 感谢@sara 的回答,我现在有了:
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc864" } :
let
gitchapter = nixpkgs.pkgs.haskell.packages.${compiler}.callCabal2nix "gitchaper" (./.) {};
zzzzz = nixpkgs.pkgs.haskell.lib.overrideCabal gitchapter;
in
nixpkgs.pkgs.haskell.packages.${compiler}.callPackage (zzzzz) { }
所以我想现在是确定如何覆盖该依赖关系的问题。
【问题讨论】: