在查询黑客包时,the manual建议使用以下命令:
$ nix-env -f "<nixpkgs>" -qaP -A haskellPackages因此,在搜索Haskell包时,我们将'active Nix表达式‘定义为"“。
这个表达式"“是什么意思?它是在哪里定义的?我没有该名称的频道,也看不到它出现在我的/etc/nixos/configuration.nix文件中。
发布于 2019-07-13 04:39:20
来自man nix-env (可能还有其他来源):
NIX_PATH
A colon-separated list of directories used to look up Nix
expressions enclosed in angle brackets (i.e., <path>). For
instance, the value
/home/eelco/Dev:/etc/nixos
will cause Nix to look for paths relative to /home/eelco/Dev and
/etc/nixos, in that order. It is also possible to match paths
against a prefix. For example, the value
nixpkgs=/home/eelco/Dev/nixpkgs-branch:/etc/nixos
will cause Nix to search for <nixpkgs/path> in
/home/eelco/Dev/nixpkgs-branch/path and /etc/nixos/nixpkgs/path.在我的机器上,NIX_PATH是nixpkgs=/Users/me/.nix-defexpr/channels/nixpkgs,所以<nixpkgs>指的是我订阅的nixpkgs频道。
通常,<...>会导致将路径视为在NIX_PATH指定的某个目录中找到的路径,而不是逐字处理。
https://stackoverflow.com/questions/57013604
复制相似问题