From 6ea7ef821535ed168e411fc341f217c742831051 Mon Sep 17 00:00:00 2001 From: Ryan Yin Date: Tue, 10 Dec 2024 21:26:24 +0800 Subject: [PATCH] chore: add note --- docs/en/nixos-with-flakes/nixos-with-flakes-enabled.md | 4 ++++ docs/zh/nixos-with-flakes/nixos-with-flakes-enabled.md | 3 +++ 2 files changed, 7 insertions(+) diff --git a/docs/en/nixos-with-flakes/nixos-with-flakes-enabled.md b/docs/en/nixos-with-flakes/nixos-with-flakes-enabled.md index a252fc9..03bbda5 100644 --- a/docs/en/nixos-with-flakes/nixos-with-flakes-enabled.md +++ b/docs/en/nixos-with-flakes/nixos-with-flakes-enabled.md @@ -104,6 +104,10 @@ Now, when you execute `sudo nixos-rebuild switch` to apply the configuration, th should not change at all because we have simply switched to using Nix Flakes, and the configuration content remains consistent with before. +> If your system's hostname is not `my-nixos`, you need to modify the name of +> `nixosConfigurations` in `flake.nix`, or use `--flake /etc/nixos#my-nixos` to specify +> the configuration name. + After the switch, we can manage the system through the Flakes feature. Currently, our flake includes these files: diff --git a/docs/zh/nixos-with-flakes/nixos-with-flakes-enabled.md b/docs/zh/nixos-with-flakes/nixos-with-flakes-enabled.md index b1da54d..46be086 100644 --- a/docs/zh/nixos-with-flakes/nixos-with-flakes-enabled.md +++ b/docs/zh/nixos-with-flakes/nixos-with-flakes-enabled.md @@ -92,6 +92,9 @@ cat flake.nix 现在执行 `sudo nixos-rebuild switch` 应用配置,系统应该没有任何变化,因为我们仅仅是切换到 了 Nix Flakes,配置内容与之前还是一致的。 +> 如果你的系统 Hostname 不是 `my-nixos`,你需要在 `flake.nix` 中修改 `nixosConfigurations` +> 的名称,或者使用 `--flake /etc/nixos#my-nixos` 来指定配置名称。 + 切换完毕后,我们就可以通过 Flakes 特性来管理系统了。 目前我们的 flake 包含这几个文件: