我知道,我可以通过使用Nix-env来寻找Haskell包。
nix-env -f <nixpkgs> -qaP -A haskellPackages name_of_package
但这很缓慢,而且没有时间。 如果我试图使用新的指挥系统<代码>nix 查询,则所有Haskell包裹都是隐蔽的。
$ nix search aeson
error: no results for the given search term(s)!
利用新的<代码>nix搜索编码>指令,是否可以搜寻是否有kell包? 如果是,如何?
<><>Edit>: 我在thisirclog中找到了这方面的一些讨论,但我可以肯定这些建议在实践中的意义。 具体来说,这一部分:
20:49 <duairc> How do I make nix search include haskellPackages?
20:52 <ottidmes> duairc: you might try and call recurseIntoAttrs on haskellPackages
20:52 <rain1> thanks
20:52 <LnL> rain1: nix-env -f <nixpkgs> -qaP -A haskellPackages
20:54 <gchristensen> duairc: ^
20:54 <duairc> LnL: Thanks!
20:55 <LnL> err, wrong person
20:56 <LnL> you can also add an overlay that recurses, but that might make it
hard to find non haskell stuff if you re searching for something else
20:56 <ottidmes> I can confirm that
haskellPackages = super.recurseIntoAttrs super.haskellPackages; works though
20:58 <duairc> ottidmes: What do I do with that expression? Put it in
configuration.nix somewhere? If I type "nix search ghcid" then
will it find it?
20:59 <duairc> Ah, you re using super, so I guess it s an overlay
20:59 <clever> duairc: for `nix search` to find it, the overlay must be
somewhere in $HOME, i forget the exact path
20:59 <clever> duairc: configuration.nix only effects nixos-rebuild and
nothing else
21:00 <ottidmes> duairc: yeah, it should be put in your overlay that is
also used by nix-env the like, so not nixpkgs.overlays in your
configuration.nix as mentioned by clever, and then searching
for e.g. nix search nix-diff will result in:
* nixpkgs.haskellPackages.nix-diff (nix-diff)