diff --git a/help/_posts/2019-02-17-nix.md b/help/_posts/2019-02-17-nix.md index 472be35..edd4178 100644 --- a/help/_posts/2019-02-17-nix.md +++ b/help/_posts/2019-02-17-nix.md @@ -4,7 +4,30 @@ layout: help mirrorid: nix --- -## Nix 镜像使用帮助 +# Nix 镜像使用帮助 + +
+ + + + + [Nix](https://nixos.org/nix) 是一个支持 Linux 和 macOS 的独特的“函数式包管理器”,具有原子更新、依赖隔离、构建尽可能可复现等特点。 @@ -18,61 +41,55 @@ mirrorid: nix - 单用户安装 - ```console - $ sh <(curl https://{{ site.hostname }}/nix/latest/install) - ``` + + +{% raw %} + +{% endraw %} + + + +
+
+
+
+
+
- 多用户安装:
- ```console
- $ sh <(curl https://{{ site.hostname }}/nix/latest/install) --daemon
- ```
+
-如果需要,可以在[文件列表中手动挑选需要的版本](https://{{ site.hostname }}/nix)。
+{% raw %}
+
+{% endraw %}
-### NixOS
+
-NixOS 的安装镜像和 OVF 虚拟机镜像可以在镜像站首页“下载链接”处或
+
+
+
-### Nixpkgs binary cache
-Binary cache 的镜像位于
+
+
+
- ```nix
- nix.binaryCaches = [ "https://{{ site.hostname }}/nix-channels/store" ];
- ```
-- NixOS 22.05 及之后的版本在 `configuration.nix` 中使用如下配置(https://cache.nixos.org 会被自动添加):
-
- ```nix
- nix.settings.substituters = [ "https://{{ site.hostname }}/nix-channels/store" ];
- ```
-
-### Nixpkgs channel
-
-Channel 的镜像位于
+
+
+
+
+
+- NixOS 21.11 及之前的版本在 `configuration.nix` 中使用如下配置(https://cache.nixos.org 会被自动添加)
+
+
+
+{% raw %}
+
+{% endraw %}
+
+
+
+
+
+
+
+
+
+- NixOS 22.05 及之后的版本在 `configuration.nix` 中使用如下配置(https://cache.nixos.org 会被自动添加):
+
+
+
+{% raw %}
+
+{% endraw %}
+
+
+
+
+
+
+
+
+
+### Nixpkgs channel
+
+单独安装的 Nix 替换 `nixpkgs-unstable` 命令如下:
+
+
+
+{% raw %}
+
+{% endraw %}
+
+
+
+
+
+
+
+
+
+替换 NixOS channel 命令如下(以 root 执行):
+
+
+
+
+
+{% raw %}
+
+{% endraw %}
+
+
+
+
+
+
+
+
+