Home Explore Blog Models CI



nixpkgs

7th chunk of `nixos/doc/manual/installation/installing.chapter.md`
474503fdd57181dd9561ff7e94d050b77b21b617a03f07670000000100000860
    `--flake` here as well and specify the name of the configuration as used in
    the `flake.nix` file. For the default generated flake, this is `nixos`.

    ```ShellSession
    # nixos-install --flake 'path/to/flake.nix#nixos'
    ```

    As the last step, `nixos-install` will ask you to set the password
    for the `root` user, e.g.

    ```plain
    setting root password...
    New password: ***
    Retype new password: ***
    ```

    If you have a user account declared in your `configuration.nix` and plan to log in using this user, set a password before rebooting, e.g. for the `alice` user:

    ```ShellSession
    # nixos-enter --root /mnt -c 'passwd alice'
    ```

    ::: {.note}
    For unattended installations, it is possible to use
    `nixos-install --no-root-passwd` in order to disable the password
    prompt entirely.
    :::

6.  If everything went well:

    ```ShellSession
    # reboot
    ```

7.  You should now be able to boot into the installed NixOS. The GRUB
    boot menu shows a list of *available configurations* (initially just
    one). Every time you change the NixOS configuration (see [Changing
    Configuration](#sec-changing-config)), a new item is added to the
    menu. This allows you to easily roll back to a previous
    configuration if something goes wrong.

    Use your declared user account to log in.
    If you didn’t declare one, you should still be able to log in using the `root` user.

    ::: {.note}
    Some graphical display managers such as SDDM do not allow `root` login by default, so you might need to switch to TTY.
    Refer to [](#sec-user-management) for details on declaring user accounts.
    :::

    You may also want to install some software. This will be covered in
    [](#sec-package-management).

### Installation summary {#sec-installation-manual-summary}
[]{#sec-installation-summary} <!-- legacy anchor -->

To summarise, [Example: Commands for Installing NixOS on `/dev/sda`](#ex-install-sequence)
shows a typical sequence of commands for installing NixOS on an empty hard
drive (here `/dev/sda`). [Example: NixOS Configuration](#ex-config) shows a

Title: NixOS Installation: Password Setup, Reboot, and First Boot
Summary
This chunk outlines the concluding steps of the NixOS installation process. It details how `nixos-install` prompts for the root password and explains how to set passwords for other user accounts declared in `configuration.nix` using `nixos-enter` before rebooting. An option (`--no-root-passwd`) for unattended installations is also mentioned. After a successful installation and reboot, the GRUB boot menu will display available configurations, offering a rollback mechanism for future changes. Users are instructed to log in with their declared user account or the root user, with a note about potential `root` login restrictions in some graphical display managers. The chunk concludes by briefly introducing the 'Installation summary' section and hinting at subsequent steps like package management.