On Wed, 17 Aug 2022, Olivier Dion via <help-guix@gnu.org> wrote: > I would like to use `guix pack` but at the scheme level. I have package > records that I generate dynamically and would like to pack them > individually in the same way. Is there an easy way for that?
Here's a solution that I've scratch quickly: --8<---------------cut here---------------start------------->8--- (use-modules (guix derivations) (guix monads) (guix profiles) (guix scripts pack) (guix store)) (define* (bundle-package package . rest) (define manifest (packages->manifest (list package))) (define profile (profile (content manifest))) (run-with-store (open-connection) (mlet %store-monad ((drv (apply self-contained-tarbar (package-name package) profile rest))) (mbegin %store-monad (built-derivations (list drv)) (return (derivation->output-path drv)))))) --8<---------------cut here---------------end--------------->8--- It seems to work okay. Though? -- Olivier Dion oldiob.dev