I would like to restrict the number of files to include in my build src
to a select few.
Directly passing the list of files to src
or srcs
isn't allowed as an archive or a directory is expected.
I couldn't find a function to do this and builtins.filterSource
does not seem to work for me (no idea why -- the intermediate derivation containing the filtered files ends up empty):
files = [
./Cargo.toml
./Cargo.lock
./cpu.rs
];
src = builtins.filterSource (p: t: builtins.elem p files) ./.;
Note: I'm using the rustPlatform
builder but I don't think it matters.