【问题标题】:Where can I find the documentation (or source) of the `nix` command line tool?我在哪里可以找到 `nix` 命令行工具的文档(或源代码)?
【发布时间】:2019-10-01 18:49:29
【问题描述】:

nixrelease 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


    【解决方案1】:

    source for the nix-* commandssource for nixNixOS/nix Github 存储库中。 (所有 repo 链接都固定到最新的 2.2.2 版本。)

    我最好的猜测是,除了源 cmets 之外的所有文档都在 release notes in the Nix manual 中,从 release 2.0 开始。

    【讨论】:

    • 如果您有更多信息,请更新此答案,或者如果有更好的答案,我将删除此答案。谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-20
    • 2011-08-31
    • 1970-01-01
    • 2019-06-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多