2
2
3
3
<img src =" https://raw.githubusercontent.com/numtide/nixos-anywhere/5bdd3f3c442b923813e301b319290305353a3e7a/docs/logo.png " width =" 256 " height =" 256 " >
4
4
5
- nixos-anywhere (formally known as nixos-remote) makes it possible to install nixos from Linux machines reachable via ssh.
6
- Under the hood uses a [ kexec image] ( https://github.com/nix-community/nixos-images#kexec-tarballs ) to boot
7
- into a NixOS installer from a running Linux system.
8
- It then uses [ disko] ( https://github.com/nix-community/disko ) to partition and
9
- format the disks on the target system before it installs the user provided nixos
5
+ nixos-anywhere (formally known as nixos-remote) makes it possible to install
6
+ nixos from Linux machines reachable via ssh. Under the hood uses a
7
+ [ kexec image] ( https://github.com/nix-community/nixos-images#kexec-tarballs ) to
8
+ boot into a NixOS installer from a running Linux system. It then uses
9
+ [ disko] ( https://github.com/nix-community/disko ) to partition and format the
10
+ disks on the target system before it installs the user provided nixos
10
11
configuration.
11
12
12
13
## Requirements
@@ -20,16 +21,21 @@ If your system is not booted into a nixos installer than the following
20
21
requirements apply for kexec to succeed:
21
22
22
23
- x86_64 Linux system with kexec support (most x86_64 machine do have kexec
23
- support) or you have to provide your own [ image] ( https://github.com/numtide/nixos-anywhere#using-your-own-kexec-image )
24
+ support) or you have to provide your own
25
+ [ image] ( https://github.com/numtide/nixos-anywhere#using-your-own-kexec-image )
24
26
- At least 2.5GB RAM (swap does not count). If you do not have enough RAM you
25
27
will see failures unpacking the initrd), this is because kexec needs to load
26
28
the whole nixos into memory.
27
29
28
30
## Usage
29
- Needs a repo with your configurations with flakes. For a minimal example checkout https://github.com/numtide/nixos-anywhere-examples .
30
31
31
- Your NixOS configuration will also need a [ disko] ( https://github.com/nix-community/disko ) configuration as we can see in
32
- our [ example] ( https://github.com/numtide/nixos-anywhere-examples/blob/9768e438b1467ec55d42e096860e7199bd1ef43d/flake.nix#L15-L19 )
32
+ Needs a repo with your configurations with flakes. For a minimal example
33
+ checkout https://github.com/numtide/nixos-anywhere-examples .
34
+
35
+ Your NixOS configuration will also need a
36
+ [ disko] ( https://github.com/nix-community/disko ) configuration as we can see in
37
+ our
38
+ [ example] ( https://github.com/numtide/nixos-anywhere-examples/blob/9768e438b1467ec55d42e096860e7199bd1ef43d/flake.nix#L15-L19 )
33
39
34
40
Afterwards you can just run:
35
41
@@ -41,7 +47,8 @@ The parameter passed to `--flake` should point to your nixos configuration
41
47
exposed in your flake (` nixosConfigurations.your-system ` in the example above).
42
48
43
49
` nixos-anywhere --help `
44
- ``` shell
50
+
51
+ ``` shell
45
52
Usage: nixos-anywhere [options] ssh-host
46
53
47
54
Options:
@@ -76,21 +83,23 @@ Options:
76
83
77
84
# # Using your own kexec image
78
85
79
- By default ` nixos-anywhere` will download the kexec image from [here](https://github.com/nix-community/nixos-images#kexec-tarballs).
80
- It is also possible to provide your own by providing a file to ` --kexec` . The image will than uploaded prior to executing.
86
+ By default ` nixos-anywhere` will download the kexec image from
87
+ [here](https://github.com/nix-community/nixos-images#kexec-tarballs). It is also
88
+ possible to provide your own by providing a file to ` --kexec` . The image will
89
+ than uploaded prior to executing.
81
90
82
- ` ` ` shell
91
+ ` ` ` shell
83
92
nixos-anywhere \
84
93
--kexec " $( nix build --print-out-paths github:nix-community/nixos-images#packages.x86_64-linux.kexec-installer-nixos-unstable) /nixos-kexec-installer-x86_64-linux.tar.gz" \
85
94
--flake ' github:your-user/your-repo#your-system' \
86
95
root@yourip
87
96
` ` `
88
97
89
98
` --kexec` can be useful for example for aarch64-linux, where there is no
90
- pre-build image. The following example assumes that your local machine can
91
- build for aarch64-linux either natively or through a remote builder
99
+ pre-build image. The following example assumes that your local machine can build
100
+ for aarch64-linux either natively or through a remote builder
92
101
93
- ` ` ` shell
102
+ ` ` ` shell
94
103
nixos-anywhere \
95
104
--kexec " $( nix build --print-out-paths github:nix-community/nixos-images#packages.aarch64-linux.kexec-installer-nixos-unstable) /nixos-kexec-installer-aarch64-linux.tar.gz" \
96
105
--flake ' your-flake#your-system' \
0 commit comments