2021-02-14 05:38:20 +03:00
|
|
|
# From NixOS
|
|
|
|
|
|
|
|
## Generate Configuration
|
2021-04-23 02:10:02 +03:00
|
|
|
Assuming you're happy with your existing partition layout, you can generate a
|
2021-02-14 05:38:20 +03:00
|
|
|
basic NixOS configuration for your system using:
|
|
|
|
```sh
|
2021-09-18 22:19:35 +03:00
|
|
|
bud up
|
2021-02-14 05:38:20 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
This will make a new file `hosts/up-$(hostname).nix`, which you can edit to
|
|
|
|
your liking.
|
|
|
|
|
2021-04-27 04:29:05 +03:00
|
|
|
You must then add a host to `nixos.hosts` in flake.nix:
|
|
|
|
```nix
|
|
|
|
{
|
|
|
|
nixos.hosts = {
|
|
|
|
modules = hosts/NixOS.nix;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2021-02-14 05:38:20 +03:00
|
|
|
Make sure your `i18n.defaultLocale` and `time.timeZone` are set properly for
|
2021-05-10 22:22:16 +03:00
|
|
|
your region. Keep in mind that `networking.hostName` will be automatically
|
2021-04-27 04:29:05 +03:00
|
|
|
set to the name of your host;
|
2021-02-14 05:38:20 +03:00
|
|
|
|
2021-04-19 05:26:27 +03:00
|
|
|
Now might be a good time to read the docs on [suites](../concepts/suites.md) and
|
|
|
|
[profiles](../concepts/profiles.md) and add or create any that you need.
|
2021-02-14 05:38:20 +03:00
|
|
|
|
|
|
|
> ##### _Note:_
|
|
|
|
> While the `up` sub-command is provided as a convenience to quickly set up and
|
|
|
|
> install a "fresh" NixOS system on current hardware, committing these files is
|
|
|
|
> discouraged.
|
|
|
|
>
|
|
|
|
> They are placed in the git staging area automatically because they would be
|
|
|
|
> invisible to the flake otherwise, but it is best to move what you need from
|
|
|
|
> them directly into a host module of your own making, and commit that instead.
|
|
|
|
# Installation
|
|
|
|
|
2021-04-23 02:10:02 +03:00
|
|
|
Once you're ready to deploy `hosts/my-host.nix`:
|
2021-02-14 05:38:20 +03:00
|
|
|
```sh
|
2021-09-18 22:19:35 +03:00
|
|
|
bud my-host switch
|
2021-02-14 05:38:20 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
This calls `nixos-rebuild` with sudo to build and install your configuration.
|
|
|
|
|
|
|
|
> ##### _Notes:_
|
|
|
|
> - Instead of `switch`, you can pass `build`, `test`, `boot`, etc just as with
|
|
|
|
> `nixos-rebuild`.
|
2021-10-24 01:33:04 +03:00
|
|
|
|
2021-02-14 05:38:20 +03:00
|
|
|
|