mirror of
https://github.com/nix-community/nixos-anywhere.git
synced 2024-10-06 12:48:07 +03:00
fmt
This commit is contained in:
parent
3166275d2f
commit
0d2bc43dd6
@ -1,6 +1,6 @@
|
||||
# Table of Content: - nixos-anywhere
|
||||
|
||||
***Install NixOS everywhere via ssh***
|
||||
**_Install NixOS everywhere via ssh_**
|
||||
|
||||
<img title="" src="https://raw.githubusercontent.com/numtide/nixos-anywhere/main/docs/logo.png" alt="" width="149">
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
# How To Guide: nixos-anywhere
|
||||
|
||||
***Install NixOS everywhere via ssh***
|
||||
**_Install NixOS everywhere via ssh_**
|
||||
|
||||
<img title="" src="https://raw.githubusercontent.com/numtide/nixos-anywhere/main/docs/logo.png" alt="" width="129">
|
||||
|
||||
@ -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
|
||||
@ -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
|
||||
|
||||
- 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
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -1,6 +1,6 @@
|
||||
# Reference Manual: nixos-anywhere
|
||||
|
||||
***Install NixOS everywhere via ssh***
|
||||
**_Install NixOS everywhere via ssh_**
|
||||
|
||||
<img title="" src="https://raw.githubusercontent.com/numtide/nixos-anywhere/main/docs/logo.png" alt="" width="141">
|
||||
|
||||
@ -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 <path to configuration>#<configuration name> root@<ip address>`
|
||||
|
||||
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 |
|
||||
| --- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
|
@ -11,7 +11,10 @@
|
||||
- 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.
|
||||
|
@ -8,7 +8,8 @@
|
||||
|
||||
## 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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user