Skip to content

Commit ea20a65

Browse files
committed
docs: Update the CLI documentation
Closes: #410
1 parent c102ff8 commit ea20a65

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

docs/cli.md

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ Usage: nixos-anywhere [options] [<ssh-host>]
88
Options:
99
1010
* -f, --flake <flake_uri>
11-
set the flake to install the system from.
11+
set the flake to install the system from. i.e.
12+
nixos-anywhere --flake .#mymachine
13+
Also supports variants:
14+
nixos-anywhere --flake .#nixosConfigurations.mymachine.config.virtualisation.vmVariant
1215
* --target-host <ssh-host>
13-
specified the SSH target host to deploy onto.
16+
set the SSH target host to deploy onto.
1417
* -i <identity_file>
1518
selects which SSH private key file to use.
1619
* -p, --ssh-port <ssh_port>
@@ -26,8 +29,6 @@ Options:
2629
* -s, --store-paths <disko-script> <nixos-system>
2730
set the store paths to the disko-script and nixos-system directly
2831
if this is given, flake is not needed
29-
* --no-reboot
30-
do not reboot after installation, allowing further customization of the target installation.
3132
* --kexec <path>
3233
use another kexec tarball to bootstrap NixOS
3334
* --kexec-extra-flags
@@ -38,18 +39,24 @@ Options:
3839
after kexec is executed, use a custom ssh port to connect. Defaults to 22
3940
* --copy-host-keys
4041
copy over existing /etc/ssh/ssh_host_* host keys to the installation
41-
* --stop-after-disko
42-
exit after disko formatting, you can then proceed to install manually or some other way
4342
* --extra-files <path>
4443
contents of local <path> are recursively copied to the root (/) of the new NixOS installation. Existing files are overwritten
45-
Copied files will be owned by root. See documentation for details.
44+
Copied files will be owned by root unless specified by --chown option. See documentation for details.
45+
* --chown <path> <ownership>
46+
change ownership of <path> recursively. Recommended to use uid:gid as opposed to username:groupname for ownership.
47+
Option can be specified more than once.
4648
* --disk-encryption-keys <remote_path> <local_path>
4749
copy the contents of the file or pipe in local_path to remote_path in the installer environment,
4850
after kexec but before installation. Can be repeated.
4951
* --no-substitute-on-destination
5052
disable passing --substitute-on-destination to nix-copy
53+
implies --no-use-machine-substituters
54+
* --no-use-machine-substituters
55+
don't copy the substituters from the machine to be installed into the installer environment
5156
* --debug
5257
enable debug output
58+
* --show-trace
59+
show nix build traces
5360
* --option <key> <value>
5461
nix option to pass to every nix related command
5562
* --from <store-uri>
@@ -58,6 +65,22 @@ Options:
5865
build the closure on the remote machine instead of locally and copy-closuring it
5966
* --vm-test
6067
build the system and test the disk configuration inside a VM without installing it to the target.
68+
* --generate-hardware-config nixos-facter|nixos-generate-config <path>
69+
generate a hardware-configuration.nix file using the specified backend and write it to the specified path.
70+
The backend can be either 'nixos-facter' or 'nixos-generate-config'.
71+
* --phases
72+
comma separated list of phases to run. Default is: kexec,disko,install,reboot
73+
kexec: kexec into the nixos installer
74+
disko: first unmount and destroy all filesystems on the disks we want to format, then run the create and mount mode
75+
install: install the system
76+
reboot: unmount the filesystems, export any ZFS pools and reboot the machine
77+
* --disko-mode disko|mount|format
78+
set the disko mode to format, mount or destroy. Default is disko.
79+
disko: first unmount and destroy all filesystems on the disks we want to format, then run the create and mount mode
80+
* --no-disko-deps
81+
This will only upload the disko script and not the partitioning tools dependencies.
82+
Installers usually have dependencies available.
83+
Use this option if your target machine has not enough RAM to store the dependencies in memory.
6184
* --build-on auto|remote|local
6285
sets the build on settings to auto, remote or local. Default is auto.
6386
auto: tries to figure out, if the build is possible on the local host, if not falls back gracefully to remote build

0 commit comments

Comments
 (0)