Skip to content

Commit d7d599b

Browse files
committed
docs: --chown option
1 parent 7b13780 commit d7d599b

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

docs/howtos/extra-files.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ during installation.
7575
When the files are extracted on the remote the copied data will be owned by
7676
root.
7777

78+
If you wish to change the ownership after the files are copied onto the system,
79+
you can use the `--chown` option.
80+
81+
For example, if you did `--chown /home/myuser/.ssh 1000:100`, this would equate
82+
to running `chown -R /home/myuser/.ssh 1000:100` where the uid is 1000 and the
83+
gid is 100. **Only do this when you can _guarantee_ what the uid and gid will
84+
be.**
85+
7886
### Symbolic Links
7987

8088
Do not create symbolic links to reference data to copy.

docs/reference.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ Options:
4949
copy over existing /etc/ssh/ssh_host_* host keys to the installation
5050
* --extra-files <path>
5151
contents of local <path> are recursively copied to the root (/) of the new NixOS installation. Existing files are overwritten
52-
Copied files will be owned by root. See documentation for details.
52+
Copied files will be owned by root unless specified by --chown option. See documentation for details.
53+
* --chown <path> <ownership>
54+
change ownership of <path> recursively. Recommended to use uid:gid as opposed to username:groupname for ownership.
55+
Option can be specified more than once.
5356
* --disk-encryption-keys <remote_path> <local_path>
5457
copy the contents of the file or pipe in local_path to remote_path in the installer environment,
5558
after kexec but before installation. Can be repeated.

src/nixos-anywhere.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ Options:
9999
copy over existing /etc/ssh/ssh_host_* host keys to the installation
100100
* --extra-files <path>
101101
contents of local <path> are recursively copied to the root (/) of the new NixOS installation. Existing files are overwritten
102-
Copied files will be owned by root. See documentation for details.
102+
Copied files will be owned by root unless specified by --chown option. See documentation for details.
103+
* --chown <path> <ownership>
104+
change ownership of <path> recursively. Recommended to use uid:gid as opposed to username:groupname for ownership.
105+
Option can be specified more than once.
103106
* --disk-encryption-keys <remote_path> <local_path>
104107
copy the contents of the file or pipe in local_path to remote_path in the installer environment,
105108
after kexec but before installation. Can be repeated.

0 commit comments

Comments
 (0)