nixpkgs 中的 haskell 个包去哪里了?
where does haskell packages in nixpkgs go?
我曾经用nix-env -qaP <haskell-package-name>
搜索过一个haskell包。但是自从我前段时间更新了我的 nix 频道后,所有 haskell 包都不见了。
具体来说:
qs@BF:~$ nix-channel --list
nixpkgs https://nixos.org/channels/nixpkgs-unstable
qs@BF:~$ nix-env --version
nix-env (Nix) 1.9
qs@BF:~$ uname -a
Linux BF 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:42 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
我想知道是否需要添加一些可能包含 haskell 包的其他频道。 Haskell NG有什么关系吗?
谢谢。
我记得在 Peter Simons 的邮件列表中看到(虽然我现在找不到确切的 link),已通过 nix-env 禁用搜索来自顶部的 Haskell 包 - level 命名空间,因为它们非常大并且 nix-env 已经很慢了。相反,所有 haskell 包都位于一个名为 haskellPackages
的单独命名空间中。有关详细信息,请参阅 here。要安装像 text
这样的 Haskell 软件包,您可以使用此命令:
nix-env -i -A nixpkgs.haskellPackages.text
要查找包名称,请使用此命令:
nix-env -f "<nixpkgs>" -qaP -A haskellPackages | grep text
引自http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure:
Nixpkgs distributes build instructions for all Haskell packages registered on
Hackage, but strangely enough normal Nix package
lookups don't seem to discover any of them, except for the default version of
ghc, cabal-install, and stack:
$ nix-env -i alex
error: selector ‘alex’ matches no derivations
$ nix-env -qa ghc
ghc-7.10.2
The Haskell package set is not registered in the top-level namespace because it
is huge. If all Haskell packages were visible to these commands, then
name-based search/install operations would be much slower than they are now. We
avoided that by keeping all Haskell-related packages in a separate attribute
set called haskellPackages
, which the following command will list:
$ nix-env -f "<nixpkgs>" -qaP -A haskellPackages
haskellPackages.a50 a50-0.5
haskellPackages.abacate haskell-abacate-0.0.0.0
haskellPackages.abcBridge haskell-abcBridge-0.12
haskellPackages.afv afv-0.1.1
haskellPackages.alex alex-3.1.4
haskellPackages.Allure Allure-0.4.101.1
haskellPackages.alms alms-0.6.7
[... some 8000 entries omitted ...]
To install any of those packages into your profile, refer to them by their
attribute path (first column):
$ nix-env -f "<nixpkgs>" -iA haskellPackages.Allure ...
The attribute path of any Haskell packages corresponds to the name of that
particular package on Hackage: the package cabal-install
has the attribute
haskellPackages.cabal-install
, and so on.
我曾经用nix-env -qaP <haskell-package-name>
搜索过一个haskell包。但是自从我前段时间更新了我的 nix 频道后,所有 haskell 包都不见了。
具体来说: qs@BF:~$ nix-channel --list nixpkgs https://nixos.org/channels/nixpkgs-unstable
qs@BF:~$ nix-env --version nix-env (Nix) 1.9
qs@BF:~$ uname -a Linux BF 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:42 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
我想知道是否需要添加一些可能包含 haskell 包的其他频道。 Haskell NG有什么关系吗?
谢谢。
我记得在 Peter Simons 的邮件列表中看到(虽然我现在找不到确切的 link),已通过 nix-env 禁用搜索来自顶部的 Haskell 包 - level 命名空间,因为它们非常大并且 nix-env 已经很慢了。相反,所有 haskell 包都位于一个名为 haskellPackages
的单独命名空间中。有关详细信息,请参阅 here。要安装像 text
这样的 Haskell 软件包,您可以使用此命令:
nix-env -i -A nixpkgs.haskellPackages.text
要查找包名称,请使用此命令:
nix-env -f "<nixpkgs>" -qaP -A haskellPackages | grep text
引自http://nixos.org/nixpkgs/manual/#users-guide-to-the-haskell-infrastructure:
Nixpkgs distributes build instructions for all Haskell packages registered on Hackage, but strangely enough normal Nix package lookups don't seem to discover any of them, except for the default version of ghc, cabal-install, and stack:
$ nix-env -i alex error: selector ‘alex’ matches no derivations $ nix-env -qa ghc ghc-7.10.2
The Haskell package set is not registered in the top-level namespace because it is huge. If all Haskell packages were visible to these commands, then name-based search/install operations would be much slower than they are now. We avoided that by keeping all Haskell-related packages in a separate attribute set called
haskellPackages
, which the following command will list:$ nix-env -f "<nixpkgs>" -qaP -A haskellPackages haskellPackages.a50 a50-0.5 haskellPackages.abacate haskell-abacate-0.0.0.0 haskellPackages.abcBridge haskell-abcBridge-0.12 haskellPackages.afv afv-0.1.1 haskellPackages.alex alex-3.1.4 haskellPackages.Allure Allure-0.4.101.1 haskellPackages.alms alms-0.6.7 [... some 8000 entries omitted ...]
To install any of those packages into your profile, refer to them by their attribute path (first column):
$ nix-env -f "<nixpkgs>" -iA haskellPackages.Allure ...
The attribute path of any Haskell packages corresponds to the name of that particular package on Hackage: the package
cabal-install
has the attributehaskellPackages.cabal-install
, and so on.