【发布时间】:2019-10-01 18:49:29
【问题描述】:
nix 在release 2.0 中引入“最终将所有nix-* 命令替换为更一致和设计更好的用户界面。”目前还没有手册页,@987654325 @flag 有点简洁,没有任何例子:
$ nix --help
Usage: nix <COMMAND> <FLAGS>... <ARGS>...
...
Note: this program is EXPERIMENTAL and subject to change.
或者
$ nix repl --help
Usage: nix repl <FLAGS>... <FILES>...
Summary: start an interactive environment for evaluating Nix expressions.
Flags:
--arg <NAME> <EXPR> argument to be passed to Nix functions
--argstr <NAME> <STRING> string-valued argument to be passed to Nix functions
-I, --include <PATH> add a path to the list of locations used to look up <...> file names
Note: this program is EXPERIMENTAL and subject to change.
帮助部分底部有一条警告“此程序是实验性的,可能会更改”,但nix 命令示例已经出现(尽管分散在各处) Nix 手册。参见 NixOS 手册中的5.3. Modularity,例如:
$ nix repl '<nixpkgs/nixos>'
nix-repl> config.networking.hostName
"mandark"
nix-repl> map (x: x.hostName) config.services.httpd.virtualHosts
[ "example.org" "example.gov" ]
至少找到源文档或开发文档会很有帮助。
【问题讨论】:
标签: nix