From 1bf92732b850aedade23ad03ac812d33f5419d32 Mon Sep 17 00:00:00 2001 From: Zenithal Date: Fri, 10 Mar 2023 13:56:33 +0000 Subject: [PATCH] help: nix: split and transpile from mirrorz Closes https://github.com/tuna/issues/issues/1692 https://github.com/mirrorz-org/mirrorz-help/commit/a671071929f922309149f16d2bebb17fda4f3e93 --- help/_posts/2019-02-17-nix.md | 107 ++++++++++-------- help/_posts/2023-03-10-nix-channels.md | 143 +++++++++++++++++++++++++ 2 files changed, 205 insertions(+), 45 deletions(-) create mode 100644 help/_posts/2023-03-10-nix-channels.md 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 %}
+
+
+
+
+
+
+
+
+