Flakes/zh: Difference between revisions

Weijia (talk | contribs)
Created page with "* <code>builtins.currentSystem</code> 函数是非确定且不纯的,因为它反映了执行推导的主机系统。通常可以通过将系统类型(例如 x86_64-linux)显式传递给需要它的 Derivations 来避免这种情况。"
Weijia (talk | contribs)
Created page with "* <code>builtins.getEnv</code> 函数也是不纯的。请避免从环境变量中读取数据,同样,也不要引用 flake 目录之外的文件。"
Line 299: Line 299:
* <code>builtins.currentSystem</code> 函数是非确定且不纯的,因为它反映了执行推导的主机系统。通常可以通过将系统类型(例如 x86_64-linux)显式传递给需要它的 Derivations 来避免这种情况。
* <code>builtins.currentSystem</code> 函数是非确定且不纯的,因为它反映了执行推导的主机系统。通常可以通过将系统类型(例如 x86_64-linux)显式传递给需要它的 Derivations 来避免这种情况。


<div lang="en" dir="ltr" class="mw-content-ltr">
*  <code>builtins.getEnv</code> 函数也是不纯的。请避免从环境变量中读取数据,同样,也不要引用 flake 目录之外的文件。
*  <code>builtins.getEnv</code> is also impure. Avoid reading from environment variables and likewise, do not reference files outside of the flake's directory.
</div>


<div lang="en" dir="ltr" class="mw-content-ltr">
<div lang="en" dir="ltr" class="mw-content-ltr">