Skip to content

Commit 66c5e42

Browse files
costowellMic92
authored andcommitted
docs: --chown option
1 parent a54a9bd commit 66c5e42

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
@@ -101,7 +101,10 @@ Options:
101101
copy over existing /etc/ssh/ssh_host_* host keys to the installation
102102
* --extra-files <path>
103103
contents of local <path> are recursively copied to the root (/) of the new NixOS installation. Existing files are overwritten
104-
Copied files will be owned by root. See documentation for details.
104+
Copied files will be owned by root unless specified by --chown option. See documentation for details.
105+
* --chown <path> <ownership>
106+
change ownership of <path> recursively. Recommended to use uid:gid as opposed to username:groupname for ownership.
107+
Option can be specified more than once.
105108
* --disk-encryption-keys <remote_path> <local_path>
106109
copy the contents of the file or pipe in local_path to remote_path in the installer environment,
107110
after kexec but before installation. Can be repeated.

0 commit comments

Comments
 (0)