Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow extra files in the tarball #612

Open
pedorich-n opened this issue Jan 2, 2025 · 1 comment
Open

Allow extra files in the tarball #612

pedorich-n opened this issue Jan 2, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@pedorich-n
Copy link

pedorich-n commented Jan 2, 2025

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:

mkdir -p "$root/etc/nixos"
cp -R ${lib.cleanSource cfg.configPath}/. "$root/etc/nixos"
chmod -R u+w "$root/etc/nixos"

Inspired by NixOS-anywhere's --extra-files: https://github.com/nix-community/nixos-anywhere/blob/97b45ac774699b1cfd267e98a8bdecb74bace593/docs/howtos/extra-files.md

@pedorich-n pedorich-n added the enhancement New feature or request label Jan 2, 2025
@terlar
Copy link
Contributor

terlar commented Jan 3, 2025

There was some discussion on this topic inside #304

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants