NixOS/zh: Difference between revisions

Weijia (talk | contribs)
Created page with "=== Nix Store 的使用 ==="
Weijia (talk | contribs)
Created page with "新手的大多数困惑源于配置文件和所有已安装软件包均存储于只读的 <code>/nix/store</code> 目录树下这一事实。这实际上使得手动编辑系统配置变得不可能;所有配置更改必须通过编辑 <code>/etc/nixos/configuration.nix</code> 文件并运行 <code>nixos-rebuild switch</code> 后才可生效。NixOS 提供了模块系统以供编辑所有需要的配置。用户应在期望通过..."
Line 108: Line 108:
=== Nix Store 的使用 ===
=== Nix Store 的使用 ===


<div lang="en" dir="ltr" class="mw-content-ltr">
新手的大多数困惑源于配置文件和所有已安装软件包均存储于只读的 <code>/nix/store</code> 目录树下这一事实。这实际上使得手动编辑系统配置变得不可能;所有配置更改必须通过编辑 <code>/etc/nixos/configuration.nix</code> 文件并运行 <code>nixos-rebuild switch</code> 后才可生效。NixOS 提供了[[Special:MyLanguage/NixOS_modules|模块系统]]以供编辑所有需要的配置。用户应在期望通过低层级的 NixOS 功能(如 activation scripts)手动添加文件或配置之前,首先使用[https://search.nixos.org/options 配置选项搜索工具]检查所需选项是否已存在。
A lot of confusion for newcomers arises from the fact that configuration is stored in the read-only <code>/nix/store</code> tree along with all the installed packages. This fact makes it impossible to manually edit system configuration; all configuration changes must be performed by editing the <code>/etc/nixos/configuration.nix</code> file and executing <code>nixos-rebuild switch</code>. NixOS provides the [[Special:MyLanguage/NixOS_modules|module system]] for editing all required configurations. Users should first use [https://search.nixos.org/options the option search tool] to check if the option they need exists before attempting to manually add files or configuration via low-level NixOS features like activation scripts.
</div>


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