Home Explore Blog Models CI



nixpkgs

6th chunk of `nixos/doc/manual/installation/installing.chapter.md`
ac9e2408dbd620a445f6f2cd83a03e4ecc6d0d3eba50bd9d0000000100000d3a
        With systemd-boot, you should not need any special configuration to detect
        other installed systems. With GRUB, set [](#opt-boot.loader.grub.useOSProber)
        to `true`, but this will only detect windows partitions, not other Linux
        distributions. If you dual boot another Linux distribution, use systemd-boot
        instead.

    If you need to configure networking for your machine the
    configuration options are described in [](#sec-networking). In
    particular, while wifi is supported on the installation image, it is
    not enabled by default in the configuration generated by
    `nixos-generate-config`.

    Another critical option is `fileSystems`, specifying the file
    systems that need to be mounted by NixOS. However, you typically
    don't need to set it yourself, because `nixos-generate-config` sets
    it automatically in `/mnt/etc/nixos/hardware-configuration.nix` from
    your currently mounted file systems. (The configuration file
    `hardware-configuration.nix` is included from `configuration.nix`
    and will be overwritten by future invocations of
    `nixos-generate-config`; thus, you generally should not modify it.)
    Additionally, you may want to look at [Hardware configuration for
    known-hardware](https://github.com/NixOS/nixos-hardware) at this
    point or after installation.

    ::: {.note}
    Depending on your hardware configuration or type of file system, you
    may need to set the option `boot.initrd.kernelModules` to include
    the kernel modules that are necessary for mounting the root file
    system, otherwise the installed system will not be able to boot. (If
    this happens, boot from the installation media again, mount the
    target file system on `/mnt`, fix `/mnt/etc/nixos/configuration.nix`
    and rerun `nixos-install`.) In most cases, `nixos-generate-config`
    will figure out the required modules.
    :::

5.  Do the installation:

    ```ShellSession
    # nixos-install
    ```

    This will install your system based on the configuration you
    provided. If anything fails due to a configuration problem or any
    other issue (such as a network outage while downloading binaries
    from the NixOS binary cache), you can re-run `nixos-install` after
    fixing your `configuration.nix`.

    If you opted for a flake-based configuration, you will need to pass the
    `--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

Title: Completing NixOS Installation: Configuration Review and Installation Execution
Summary
This chunk details the final steps of the NixOS installation process. It clarifies bootloader behavior for detecting other operating systems (systemd-boot is recommended for dual-booting Linux, GRUB's `useOSProber` only finds Windows). It then discusses networking configuration, noting that Wi-Fi isn't enabled by default. The chunk explains that `nixos-generate-config` automatically sets up `fileSystems` in `hardware-configuration.nix`, which should not be manually altered. A crucial warning is provided about potentially needing to manually specify `boot.initrd.kernelModules` for certain hardware or file systems to ensure the system can boot. Finally, it outlines how to execute the installation using `nixos-install` (with an `--flake` option for flake-based setups), set the root password, and optionally set passwords for other declared users before rebooting into the newly installed NixOS system.