Skip to content

Function for transforming store path contents #264541

@infinisil

Description

@infinisil

Issue description

I've been working on the new file set library in recent months, which allows selecting local eval-time paths to add to the store. Notably this library does not support handling of store paths, see #264537 for why not.

However, it would be very doable to have a simple function for doing arbitrary transformations over store paths with a command. I can imagine an interface like this:

pkgs.transformStorePath {
  path = pkgs.hello;
  command = ''
    rm -rf share
    mv $out/bin/{hello,hallo}
  '';
}

I can also imagine there being alternate more convenient approaches, suggestions welcome.

Ping @roberth @fricklerhandwerk

This issue is sponsored by Antithesis

Metadata

Metadata

Assignees

Labels

0.kind: enhancementAdd something new or improve an existing system.2.status: stalehttps://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md6.topic: libThe Nixpkgs function library
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions