Skip to content

docs(no-os): simpler and more complete #489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 31 additions & 5 deletions docs/howtos/no-os.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,41 @@ If an installer is detected, `nixos-anywhere` will not attempt to `kexec` into
its own image. This is particularly useful for targets that don't have enough
RAM for `kexec` or don't support `kexec`.

Often you will need some kind of network connectivity before installing NixOS.
Use the live system to connect to some network.

NixOS starts an SSH server on the installer by default, but you need to set a
password in order to access it. To set a password for the `nixos` user, run the
following command in a terminal on the NixOS machine:

```
```shell
passwd
```

If you don't know the IP address of the installer on your network, you can find
## Local installation

If your source and target machines are the same (the one booted from USB), you
can install NixOS by running `nixos-anywhere` like this:

```shell
# Set your flake URL
flake='github:nix-community/nixos-anywhere-examples#generic'

# Install it
nix --extra-experimental-features 'nix-command flakes' run github:nix-community/nixos-anywhere -- --flake "$flake" --target-host nixos@localhost --build-on remote
```

In this kind of installation, the flag `--build-on remote` makes sure the build
is done after partitioning and mounting `/nix`. Otherwise, it would be prebuilt
in the live system, which could then run out of space quickly.

## Remote installation

If your source and target machines are different (for example, you want to
install a new laptop, but the flake is in another laptop), both will have to
connect. This is commonly done by connecting both to the same local network.

If you don't know the IP address of the target machine on your network, you can find
it by running the following command:

```
Expand Down Expand Up @@ -57,15 +83,15 @@ installer's IP addresses are `10.0.2.15`, `fec0::5054:ff:fe12:3456`, and
To test if you can connect and your password works, you can use the following
SSH command (replace the IP address with your own):

```
```shell
ssh -v nixos@fec0::5054:ff:fe12:3456
```

You can then use the IP address to run `nixos-anywhere` like this:

```
```shell
nix run github:nix-community/nixos-anywhere -- --flake '.#myconfig' --target-host nixos@fec0::5054:ff:fe12:3456
```

This example assumes a flake in the current directory containing a configuration
named `myconfig`.
named `myconfig`.
Loading