From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id xgmcNsJW/WKLKQAAbAwnHQ (envelope-from ) for ; Wed, 17 Aug 2022 22:59:46 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id mJ5SNcJW/WIXkgAAauVa8A (envelope-from ) for ; Wed, 17 Aug 2022 22:59:46 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 82D61C42B for ; Wed, 17 Aug 2022 22:59:46 +0200 (CEST) Received: from localhost ([::1]:45702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oOQ8f-0006kw-4y for larch@yhetil.org; Wed, 17 Aug 2022 16:59:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOQ8V-0006kY-AD for help-guix@gnu.org; Wed, 17 Aug 2022 16:59:35 -0400 Received: from smtp.polymtl.ca ([132.207.4.11]:45075) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOQ8R-00021s-O7 for help-guix@gnu.org; Wed, 17 Aug 2022 16:59:34 -0400 Received: from localhost (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 27HKxHFG005619 for ; Wed, 17 Aug 2022 16:59:22 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 27HKxHFG005619 To: help-guix@gnu.org Subject: Re: guix-pack on package record In-Reply-To: <87tu6ak3lb.fsf@laura> References: <87tu6ak3lb.fsf@laura> Date: Wed, 17 Aug 2022 16:59:17 -0400 Message-ID: <87r11ek2my.fsf@laura> MIME-Version: 1.0 Content-Type: text/plain X-Poly-FromMTA: (modemcable094.169-200-24.mc.videotron.ca [24.200.169.94]) at Wed, 17 Aug 2022 20:59:17 +0000 Received-SPF: pass client-ip=132.207.4.11; envelope-from=olivier.dion@polymtl.ca; helo=smtp.polymtl.ca X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" Reply-to: Olivier Dion From: Olivier Dion via X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660769986; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=/Kcp++ZtJflAbfUkkBHDOLHs+U2uG0wTYMCzSI7g4wo=; b=pF+hJDAs2fNsCuBdo8sPdG0TjojHg5DOEictzY5nS+Yd2ELhVjtcm4v1a5Up0jjwQGc7j3 C2VrpMdgvqGtWNj81YUWPSpoog4Bfyam1VVsN1PLgawMslXhylOXkKX9XdLTJjwmIh3T7n E/XeInaJJWdi33JC4IO4vnHFVlmVHX/01TVhGl5K7fLYjFnRrdutlMWfQGox7nk1MLJuEy SZMC3wJknftZYyGY71PYRQbGRVuGuOJUbdDOWaFuhfee4sHaBF2HYHGEbuM0n/Eb8Py5Cv Ff4jLw1ShbBCcLZmQlz1f2hsH8VrBRpCETdBkoa2hQOjyzAF0E/rado0tf06bQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660769986; a=rsa-sha256; cv=none; b=PAv6NXwdBwBAObfHGOhphKTYUP84zXLhuz335aAo9bxgcI2H5k3L8OjgGH11E558gn/DIf wcBqraY+AomON86NrNN2+1IMccws3bfi3CT2QPXeB8Z504k1YLq8tnsbbhhnDjo/oswmum hJfFp4xPMtI1vWSr91COVrYeDNTFD2t5sKgtaZqgiUS/L3lt3v3BNQtO0jzy4eutcOscfV NvrqWHS+G12D2cSvaUwNzTIrrk7j81K5J22qJt6x87mSk0bsyX4TmPSe6alICViickH8gK U+7QKhvUbPn1ikjW+K/If5TGV3RrN3z2IBtfHVq2kar4jf6l9A1Jldtg1iKznA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.46 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 82D61C42B X-Spam-Score: -2.46 X-Migadu-Scanner: scn0.migadu.com X-TUID: f4rgIOKOu8Q8 On Wed, 17 Aug 2022, Olivier Dion via 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