mirror of
https://github.com/ryan4yin/nixos-and-flakes-book.git
synced 2024-12-23 23:29:19 +01:00
feat: add notes for nixos-rebuild
This commit is contained in:
parent
e94bb6c9b1
commit
4f60d3ccc8
@ -214,6 +214,8 @@ After adjusting the parameters, the content of `/etc/nixos/flake.nix` is as foll
|
||||
|
||||
Then run `sudo nixos-rebuild switch` to apply the configuration, and home-manager will be installed automatically.
|
||||
|
||||
> If your system's hostname is not `nixos-test`, you need to modify the name of `nixosConfigurations` in `flake.nix`, or use `--flake /etc/nixos#nixos-test` to specify the configuration name.
|
||||
|
||||
After the installation, all user-level packages and configuration can be managed through `/etc/nixos/home.nix`. When running `sudo nixos-rebuild switch`, the configuration of home-manager will be applied automatically. (**It's not necessary to run `home-manager switch` manually**!)
|
||||
|
||||
To find the options we can use in `home.nix`, referring to the following documents:
|
||||
|
@ -217,6 +217,8 @@ nix flake new example -t github:nix-community/home-manager#nixos
|
||||
|
||||
然后执行 `sudo nixos-rebuild switch` 应用配置,即可完成 home-manager 的安装。
|
||||
|
||||
> 如果你的系统 Hostname 不是 `nixos-test`,你需要在 `flake.nix` 中修改 `nixosConfigurations` 的名称,或者使用 `--flake /etc/nixos#nixos-test` 来指定配置名称。
|
||||
|
||||
安装完成后,所有用户级别的程序、配置,都可以通过 `/etc/nixos/home.nix` 管理,并且执行 `sudo nixos-rebuild switch` 时也会自动应用 home-manager 的配置。
|
||||
|
||||
`home.nix` 中 Home Manager 的配置项有这几种查找方式:
|
||||
|
Loading…
Reference in New Issue
Block a user