Skip to content

Allow extra files in the tarball #612

Open
@pedorich-n

Description

@pedorich-n

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions