Open
Description
Problem
I would like to include extra files in the tarball without exposing them to the /nix/store
(e.g. not using environment.etc
or systemd.tmpfiles
).
Use case: include custom SSH host keys.
Solution
I think the easiest thing would be to add a --extra-files
flag to the tarballBuilder
script, which is expected to be a folder with the correct directory structure inside, and then do cp -R "${extraFiles}/." "$root"
. Similar to how it's already done for the config:
NixOS-WSL/modules/build-tarball.nix
Lines 87 to 89 in dee4425
Inspired by NixOS-anywhere's --extra-files
: https://github.com/nix-community/nixos-anywhere/blob/97b45ac774699b1cfd267e98a8bdecb74bace593/docs/howtos/extra-files.md