gpt4 book ai didi

haskell - 如何在 Nix 中使用特定版本的 Haskell 包?

转载 作者:行者123 更新时间:2023-12-05 03:55:46 25 4
gpt4 key购买 nike

我只想在我用 Nix 构建的项目中使用最新版本的 pandoc,Haskell 包。

这是我的 shell.nix 文件。注释掉的部分是我尝试覆盖包版本的地方,但它似乎不起作用。

with import <nixpkgs> {};

( let
colormath = pkgs.python3Packages.buildPythonPackage rec {
pname = "colormath";
version = "3.0.0";

src = pkgs.python3Packages.fetchPypi{
inherit version;
inherit pname;
sha256 = "05qjycgxp3p2f9n6lmic68sxmsyvgnnlyl4z9w7dl9s56jphaiix";
};

buildInputs = [ pkgs.python3Packages.numpy pkgs.python3Packages.networkx ];
};
spacy_conll = pkgs.python3Packages.buildPythonPackage rec {
pname = "spacy_conll";
version = "1.0.1";

src = pkgs.python3Packages.fetchPypi{
inherit version;
inherit pname;
sha256 = "1wffwp539i3yvqx6dl3ki5fmmbrpqpnf0ymg5806czk0rh7843j7";
};

buildInputs = [ pkgs.python3Packages.spacy pkgs.python3Packages.packaging ];
};
# pandoc = pkgs.haskellPackages.pandoc.override {
# version = "2.9.1.1";
# };

in pkgs.mkShell {
shellHook = "eval $(egrep ^export ${ghc}/bin/ghc)";
buildInputs = with pkgs; [
(python3.withPackages (ps: with ps; [
matplotlib
spacy
pandas
spacy_models.en_core_web_md
jupyter
scikitlearn
nltk
altair
vega_datasets
cherrypy
dominate
plotly
colormath
falcon # Spacy server from Haskell Cookbook
spacy_conll
]))
(haskellPackages.ghcWithPackages (ps: with ps; [ lens pandoc roman-numerals doclayout ] ))
];
}
)

最佳答案

Pandoc 2.9.1.1 在 nixpkgs 中作为 haskellPackages.pandoc_2_9_1_1 可用。我建议您使用它而不是尝试覆盖包,因为依赖项存在一些差异。不过,作为引用,下面是您将如何覆盖 haskellPackages:

let
hsPkgs = pkgs.haskellPackages.override {
overrides = self: super: {
pandoc = pkgs.haskell.lib.overrideCabal super.pandoc {
version = "2.9.1.1";
sha256 = "0vc1ld57nv27gwq4mq0wdal8k2wxvsc0f3m2jwq9nkq7wbpwa8cx";
};
};
};
in pkgs.mkShell {
buildInputs = with pkgs; [
(hsPkgs.ghcWithPackages (ps: with ps; [ pandoc ] ))
];
}

关于haskell - 如何在 Nix 中使用特定版本的 Haskell 包?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59937924/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com