【发布时间】:2020-12-09 09:11:32
【问题描述】:
我正在寻找类似的东西:
shell.nix
{ pkgs ? import <nixpkgs> {} }:
let
threadscope = ...
speedscope = ...
in
stdenv.mkDerivation {
name = "haskell-env";
nativeBuildInputs = [
# Haskell tools
ghcid ghc
# Profiling tools
threadscope
speedscope
];
}
那我可以用nix-shell:
% nix-shell
...
nix-shell % threadscope <some-commands>
nix-shell % speedscope <some-commands>
您通常只是从 github / hackage / stackage 的源代码构建还是使用pkgs.haskellPackages.<my-package>?
【问题讨论】:
-
我已将您的示例更改为使用更适合 shell 工具的
nativeBuildInputs。buildInputs适用于库等,但包括次优的遗留行为。例如,buildInputs不支持 shell 选项卡完成。不过,您会看到很多使用buildInputs的示例,因为它有点用,而且是最近才发生的变化。