From 0d2bc43dd6853f130e755a5fea5cd874171ece9c Mon Sep 17 00:00:00 2001 From: zimbatm Date: Mon, 29 May 2023 14:54:03 +0200 Subject: [PATCH] fmt --- README.md | 2 +- docs/INDEX.md | 2 +- docs/howtos.md | 49 ++++++++++++++++++++++++++++--------------- docs/quickstart.md | 10 ++++----- docs/reference.md | 9 +++++--- docs/requirements.md | 11 ++++++---- docs/supportmatrix.md | 9 ++++---- 7 files changed, 57 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index ee0a961..20e03a1 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,7 @@ data has been migrated. - - Can be any Linux machine with Nix installed, or a NixOS machine. - Target Machine: - + - Unless you're using the option to boot from a NixOS installer image, or providing your own `kexec` image, it must be running x86-64 Linux with kexec support. Most `x86_64` Linux systems do have kexec support. By providing diff --git a/docs/INDEX.md b/docs/INDEX.md index 368a398..67998ac 100644 --- a/docs/INDEX.md +++ b/docs/INDEX.md @@ -1,6 +1,6 @@ # Table of Content: - nixos-anywhere -***Install NixOS everywhere via ssh*** +**_Install NixOS everywhere via ssh_** diff --git a/docs/howtos.md b/docs/howtos.md index 06d5fef..6b5570e 100644 --- a/docs/howtos.md +++ b/docs/howtos.md @@ -1,6 +1,6 @@ # How To Guide: nixos-anywhere -***Install NixOS everywhere via ssh*** +**_Install NixOS everywhere via ssh_** @@ -16,13 +16,23 @@ ## Installing on a machine with no operating system -If your machine doesn't currently have an operating system installed, you still run `nixos-anywhere` remotely to automate the install. To do this, you would first need to boot the target machine from the standard NixOS installer. You can either boot from a USB or use `netboot`. +If your machine doesn't currently have an operating system installed, you still +run `nixos-anywhere` remotely to automate the install. To do this, you would +first need to boot the target machine from the standard NixOS installer. You can +either boot from a USB or use `netboot`. -The [NixOS installation guide](https://nixos.org/manual/nixos/stable/index.html#sec-booting-from-usb) has detailed instructions on how to boot the installer. +The +[NixOS installation guide](https://nixos.org/manual/nixos/stable/index.html#sec-booting-from-usb) +has detailed instructions on how to boot the installer. -When you run `nixos-anywhere`, it will determine whether a NixOS installer is present by checking whether the `/etc/os-release` file contains the identifier `VARIANT=installer`. This identifier is available on releases NixOS 23.05 or later. +When you run `nixos-anywhere`, it will determine whether a NixOS installer is +present by checking whether the `/etc/os-release` file contains the identifier +`VARIANT=installer`. This identifier is available on releases NixOS 23.05 or +later. -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`. +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`. 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 @@ -57,7 +67,7 @@ $ ip addr This will display the IP addresses assigned to your network interface(s), including the IP address of the installer. In the example output below, the -installer's IP addresses are `10.0.2.15`, `fec0::5054:ff:fe12:3456`, and +installer's IP addresses are `10.0.2.15`, `fec0::5054:ff:fe12:3456`, and `fe80::5054:ff:fe12:3456%eth0`: To test if you can connect and your password works, you can use the following @@ -73,18 +83,23 @@ You can then use the IP address to run `nixos-anywhere` like this: nix run github:numtide/nixos-anywhere -- --flake '.#myconfig' nixos@fec0::5054:ff:fe12:3456 ``` -This example assumes a flake in the curent directory containing a configuration named `myconfig`. +This example assumes a flake in the curent directory containing a configuration +named `myconfig`. ## Using your own kexec image -By default, `nixos-anywhere` downloads the kexec image from the [NixOS images repository](https://github.com/nix-community/nixos-images#kexec-tarballs). +By default, `nixos-anywhere` downloads the kexec image from the +[NixOS images repository](https://github.com/nix-community/nixos-images#kexec-tarballs). +However, you can provide your own `kexec` image file if you need to use a +different one. This is particularly useful for architectures other than +`x86_64`, since they don't have a pre-build image. -However, you can provide your own `kexec` image file if you need to use a different one. This is particularly useful for architectures other than `x86_64`, since they don't have a pre-build image. +To do this, use the `--kexec` command line switch followed by the path to your +image file. The image will be uploaded prior to execution. -To do this, use the `--kexec` command line switch followed by the path to your image file. The image will be uploaded prior to execution. - -Here's an example command that demonstrates how to use a custom kexec image with `nixos-anywhere` for aarch64 instead of the default `x86_64` architecture: +Here's an example command that demonstrates how to use a custom kexec image with +`nixos-anywhere` for aarch64 instead of the default `x86_64` architecture: ``` nix run github:numtide/nixos-anywhere -- \ @@ -96,15 +111,15 @@ nix run github:numtide/nixos-anywhere -- \ Make sure to replace `github:your-user/your-repo#your-system` with the appropriate Flake URL representing your NixOS configuration. +The example above assumes that your local machine can build for aarch64 in one +of the following ways: - -The example above assumes that your local machine can build for aarch64 in one of the following ways: - -- Natively +- Natively - Through a remote builder -- By emulating the architecture with qemu using the following NixOS configuration: +- By emulating the architecture with qemu using the following NixOS + configuration: ```nix { diff --git a/docs/quickstart.md b/docs/quickstart.md index bdd12ee..9fc7bc0 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -64,8 +64,8 @@ NixOS has been installed. [here](https://github.com/numtide/nixos-anywhere-examples/blob/main/disk-config.nix). This configures a standard GPT (GUID Partition Table) partition compatible with both EFI and BIOS systems, and mounts the disk as `/dev/sda`. If this - doesn’t meet your requirements, choose an example that suits your disk - layout from the + doesn’t meet your requirements, choose an example that suits your disk layout + from the [disko examples](https://github.com/nix-community/disko/tree/master/example). For more information about this configuration, refer to the [disko documentation.](https://github.com/nix-community/disko) @@ -85,15 +85,15 @@ example uses a local directory on the source machine. 6. You can now run **nixos-anywhere** from the command line as shown below, where: - + - `` is the path to the directory or repository containing `flake.nix` and `disk-config.nix` - + - `` must match the name that immediately follows the text `nixosConfigurations.` in the flake, as indicated by the comment in the [example](https://github.com/numtide/nixos-anywhere-examples/blob/main/flake.nix)). - + - `` is the IP address of the target machine. ``` diff --git a/docs/reference.md b/docs/reference.md index 16f232e..2b1c53d 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -1,6 +1,6 @@ # Reference Manual: nixos-anywhere -***Install NixOS everywhere via ssh*** +**_Install NixOS everywhere via ssh_** @@ -59,11 +59,14 @@ Options: TODO: Add additional error messages and meanings. Fill in missing explanations -This section lists known error messages and their explanations. Some explanations may refer to the following CLI syntax: +This section lists known error messages and their explanations. Some +explanations may refer to the following CLI syntax: `nix run github:numtide/nixos-anywhere -- --flake # root@` -This list is not comprehensive. It's possible you may encounter errors that originate from the underlying operating system. These should be documented in the relevant operating system manual. +This list is not comprehensive. It's possible you may encounter errors that +originate from the underlying operating system. These should be documented in +the relevant operating system manual. | Id | Message | Explanation | | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | diff --git a/docs/requirements.md b/docs/requirements.md index d76e779..cb048f3 100644 --- a/docs/requirements.md +++ b/docs/requirements.md @@ -4,14 +4,17 @@ -[Documentation Index](./INDEX.md) +[Documentation Index](./INDEX.md) ## Requirements - Source Machine: - Can be any Linux or Mac computer with Nix installed, or a NixOS machine. - Destination Machine: - - Must be an x86-64 machine unless you are able to supply a `kexec` image for your CPU type. - - If you're not using the option to boot from a Nixos installer image, it must: - - Be running x86-64 Linux with kexec support . Most x86_64 Linux systems do have kexec support. + - Must be an x86-64 machine unless you are able to supply a `kexec` image for + your CPU type. + - If you're not using the option to boot from a Nixos installer image, it + must: + - Be running x86-64 Linux with kexec support . Most x86_64 Linux systems do + have kexec support. - Have at least 2.5 GB of RAM, excluding swap. diff --git a/docs/supportmatrix.md b/docs/supportmatrix.md index 4e805db..73ee45f 100644 --- a/docs/supportmatrix.md +++ b/docs/supportmatrix.md @@ -8,13 +8,14 @@ ## List of tested environments -We have verified that **nixos-anywhere** runs successfully on the environments listed below. +We have verified that **nixos-anywhere** runs successfully on the environments +listed below. **kexec boot:**    Indicates whether it can work by using a kexec boot -**Image boot:** Indicates whether it can work if booted from a NixOS installer +**Image boot:** Indicates whether it can work if booted from a NixOS installer -**Own kexec:**     Indicates whether it can work if you supply your own kexec +**Own kexec:**     Indicates whether it can work if you supply your own kexec | **Platform** | **Operating System** | kexec boot | Image boot | Own kexec | | ------------- | -------------------- | ---------- | ---------- | --------- | @@ -26,4 +27,4 @@ We have verified that **nixos-anywhere** runs successfully on the environments l | | | | | | | | | | | | -## +##