From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id mDgRGVbUq2UNgwEAqHPOHw:P1 (envelope-from ) for ; Sat, 20 Jan 2024 15:10:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id mDgRGVbUq2UNgwEAqHPOHw (envelope-from ) for ; Sat, 20 Jan 2024 15:10:30 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=wolfsden.cz header.s=mail header.b="TcbVCz1/"; dkim=pass header.d=wolfsden.cz header.s=mail header.b="TcbVCz1/"; 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"; dmarc=pass (policy=none) header.from=wolfsden.cz ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705759830; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc: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:dkim-signature; bh=RhN3urj3IiMtuNobEt9J1J1JoWskALNKI8RIr9HajRc=; b=VhVJE0Jco7nkgKHRmEegp4f8bPDNQE7LhvbEKjuIKoV6DLaAoI6UIEoE2fLoLA7jRM4jPq iZ1x8HEUEua61QydYRZHzypulAKe40tY3j1p7HBmW6ZbaEinHndsWUbuS6mVsXK+kavuBN r4XhbBO6qab4EC57af2EjtChtIMVeAt51ptRnEvon9bpX4RcennQ59UU1V4VKC2fVyV52M 91gRegsQpEYtrwz8FkxNO+Abk8wWg+81nxxdbI6tfVeP9hTXpq3LOMFTRprdbWrNTEQTOf NrMMScDxU3b69QLiSLCtbwarYdvTXTwRHaQ6rOoxERZfY0A4VrhxyXvzfieGfg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=wolfsden.cz header.s=mail header.b="TcbVCz1/"; dkim=pass header.d=wolfsden.cz header.s=mail header.b="TcbVCz1/"; 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"; dmarc=pass (policy=none) header.from=wolfsden.cz ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705759830; a=rsa-sha256; cv=none; b=tuIq6HL7zwE5cwza9x8BLOg5p+dPo83d8o68hflnqeqJUyI8i8dAHqiixBUJZU8UOPOMTv 2csnoOeguT3LnADsJaWjmoHRfE8pOkbvPoel1aXOQYdq2Hmrf/MAKRjxAJkb2F7tPhCIio nAzfA7YzKvy7B/pKj56hati7L6xMf97hOxStfZDbRAwQo/JYsdfFFHZR0y0+vDkNgV64vS +Uhar1hhj5oCnfUewgEQEyB8YKf2kp21S8idzmnqI95J/ZHtT1p0P2XfTEJHOQ09/Be7AN a55yB+wl089VCOVBlOYlvyiplBn5VBoiO/824D9O0a1rB+3q54yvHOPg8PCz0Q== 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 04AEC421AA for ; Sat, 20 Jan 2024 15:10:30 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRBQ5-0001I5-UE; Sat, 20 Jan 2024 08:29:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1rRBPx-0001Gy-2r for help-guix@gnu.org; Sat, 20 Jan 2024 08:29:50 -0500 Received: from wolfsden.cz ([37.205.8.62]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1rRBPt-0003lG-Pn for help-guix@gnu.org; Sat, 20 Jan 2024 08:29:48 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id C4AAB273903; Sat, 20 Jan 2024 13:29:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1705757380; bh=DSKpHvbqx7gVCqicKPfFzVX73D0veKBn4kxP0EqOJwI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=TcbVCz1/Jc/5+ge8O/s1dRz2zlKjSDdys+1YCHVCPl9oA44zx6P01dV85syk2ovUk DApMa2WShO+GQ/PLcNbntsdlDgCDLEyvNi1UHshGloM2b6cySTkF3LSy0Aoac8kuOP 1tNP32M98aLAJGZKo7t/CqRAV55lBGqsT8EcJsuEUlqv0O8dZGiRjwuqDTRY2nZxWw QeJkbchQAn23kySrxS8W1bOrcw3i8HGBJcFOsjCe6Jg1Yugp8cgBcxfd7mIg0KnGB4 CioC31D2xVxVj30rpLtGMqW3pMOuxd7bao9+IYHX8xYztg4xumfPBhQitEodvMtDdp CgxIcLLp/+l8CRCsG2Hwq361//4wvCy4nX2S3rOBa9BjZsOQQxJj3pM4ytE/+JpDTr BpxhHeZ7zS1FLBdsE/y8jbEU3V4xCN8FDU39btvWivqVNv1ZENAuRqPCSeijd0pChk Bxq4HcJ9Pe5/CmqcfLkisiByy71995znWSU8GuHFx6xmNXVEInICmEez26heXMkUYF 1aqB5DqL9o5fzUVCDuNZr2cb66E6vawal4ArMf5MDYyF8VsHH70ifarDWumcQKpLXl DojQdOgjvLUIrddgP7mCC6o+Re1z84EUgz0Tc0rhv/o4l5UhL2UupRmcNGwKP9r+AF O4bfO1wuzzN0xHHgRxyozfBs= Received: from localhost (unknown [193.32.127.157]) by wolfsden.cz (Postfix) with ESMTPSA id 3FFC82727C8; Sat, 20 Jan 2024 13:29:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1705757380; bh=DSKpHvbqx7gVCqicKPfFzVX73D0veKBn4kxP0EqOJwI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=TcbVCz1/Jc/5+ge8O/s1dRz2zlKjSDdys+1YCHVCPl9oA44zx6P01dV85syk2ovUk DApMa2WShO+GQ/PLcNbntsdlDgCDLEyvNi1UHshGloM2b6cySTkF3LSy0Aoac8kuOP 1tNP32M98aLAJGZKo7t/CqRAV55lBGqsT8EcJsuEUlqv0O8dZGiRjwuqDTRY2nZxWw QeJkbchQAn23kySrxS8W1bOrcw3i8HGBJcFOsjCe6Jg1Yugp8cgBcxfd7mIg0KnGB4 CioC31D2xVxVj30rpLtGMqW3pMOuxd7bao9+IYHX8xYztg4xumfPBhQitEodvMtDdp CgxIcLLp/+l8CRCsG2Hwq361//4wvCy4nX2S3rOBa9BjZsOQQxJj3pM4ytE/+JpDTr BpxhHeZ7zS1FLBdsE/y8jbEU3V4xCN8FDU39btvWivqVNv1ZENAuRqPCSeijd0pChk Bxq4HcJ9Pe5/CmqcfLkisiByy71995znWSU8GuHFx6xmNXVEInICmEez26heXMkUYF 1aqB5DqL9o5fzUVCDuNZr2cb66E6vawal4ArMf5MDYyF8VsHH70ifarDWumcQKpLXl DojQdOgjvLUIrddgP7mCC6o+Re1z84EUgz0Tc0rhv/o4l5UhL2UupRmcNGwKP9r+AF O4bfO1wuzzN0xHHgRxyozfBs= Date: Sat, 20 Jan 2024 14:29:38 +0100 From: Tomas Volf <~@wolfsden.cz> To: =?iso-8859-1?Q?Th=E9o?= Tyburn Cc: Richard Sent , help-guix@gnu.org Subject: Re: Make a simple guile script to a package - source local file Message-ID: Mail-Followup-To: =?iso-8859-1?Q?Th=E9o?= Tyburn , Richard Sent , help-guix@gnu.org References: <87jzrdtao6.fsf@posteo.net> <87h6j90zrf.fsf@posteo.net> <877ck5djur.fsf@freakingpenguin.com> <87frysi3fz.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="zUSwb+iZLlPLWCTJ" Content-Disposition: inline In-Reply-To: <87frysi3fz.fsf@posteo.net> Received-SPF: pass client-ip=37.205.8.62; envelope-from=~@wolfsden.cz; helo=wolfsden.cz X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -11.86 X-Migadu-Scanner: mx13.migadu.com X-Spam-Score: -11.86 X-Migadu-Queue-Id: 04AEC421AA X-TUID: FpodbOzuMVrC --zUSwb+iZLlPLWCTJ Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2024-01-20 12:32:08 +0000, Th=E9o Tyburn wrote: > Richard Sent writes: >=20 > > Depending on what you mean by polluting or re-entering the profile > > information all the time this might not be what you want. When I write > > scripts that rely on specific dependencies I don't want to permanently > > install, I write the shebang like this: > > > > --8<---------------cut here---------------start------------->8--- > > #!/usr/bin/env -S guix shell ruby ruby-colorize password-store -- ruby > > --8<---------------cut here---------------end--------------->8--- >=20 > This is a really nice trick ! >=20 > Unfortunately you either have to reevaluate the profile at each > run or create a profile and do something like >=20 > #!/usr/bin/env -S guix shell -p > ${GUIX_EXTRA_PROFILES}/python-pydbus/python-pydbus -- python3 It is work nothing that guix shell does cache the profiles, so it is pretty fast: $ time -p guix shell vim -- true The following derivation will be built: /gnu/store/4mlf31h32244xzcni9w43f95k8n8xf1h-profile.drv =20 applying 3 grafts for tcsh-6.24.01 ... applying 7 grafts for vim-9.0.2001 ... building CA certificate bundle... listing Emacs sub-directories... building fonts directory... building directory of Info manuals... building profile with 1 package... real 2.28 user 1.24 sys 0.09 $ time -p guix shell vim -- true real 0.11 user 0.14 sys 0.01 $ time -p guix shell vim -- true real 0.11 user 0.13 sys 0.02 >=20 > > This relies on /usr/bin/env supporting -S, which to my understanding > > isn't POSIX but instead a coreutils extension. Pretty sure --container > > would work here but I've not tried it. >=20 > Also as you mentioned, I fear I will not be able to directly > distribute this to people not running guix. >=20 > But thanks for the hint :) I am using (for guile scripts) something like: #!/bin/sh exec guix shell ... -- guile -e main -s "$0" "$@" So if the language allows you to treat the first non-shebang line as a shell script, you can suddenly get by with POSIX env (which is handy on alpine li= nux). Have a nice day, Tomas Volf --=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --zUSwb+iZLlPLWCTJ Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmWrysIACgkQL7/ufbZ/ walTng/+LAJTduno//bW6zMFJkBNa1uYT1bcUyqI+Qt4/oD3vKoACVV5/9L0EnxU WAvTrCOGweWCCGaN/HIZibsCiQBbdJivXCFsn4Cu1jTlr+kTCTO85LR0dXzhRgS7 TajR8l7/6bxW8CwmWbq1OXPq2m0vb9yv69hgBBCCG3kGC2h4J6XL9llobkNfWzqC EYj4fEfpkQznmcT+6MgsBwww2b/ydVmL6u2ogj8QFygd+lk+LXGPwYPM92klUxmS buWO3P8G5OaCWD98/1eoL+6KWE/y+n3wJ8iWrT8KpTcZKrn0kH0dXSof5eRuMuO7 ZgqCL6EWwQ24EjBe/Pph3ajdqzPV9xHNZUDo1YQcT0qHwmY4FQX/acra+MRZs/7+ rt+UEni7jKHOijo60rD85zmMFOWlOsXBlUWvpYQv9Cr9oGVyXo8GYerkWf3qpaFo Dp+IMxSqvJe2w04pTIa5Tf1q5YzbmOkJuE5iqfsGZNbYB6p1pqtqgBQ2Nv+xdGC1 mzMiHDEPNXzzWdH6qgSTZyrrSWx4yT6JC1ThmcQ/HY+SgwoBtuTbXNWnsmZrokxl Mvfj4fd8jTpVkOHded8VX4Eez6wXKrRo0TKWFTDjPszzd3EumTuaZd4LJKPZ+XPl A/58c15tRu2+QVDa8MNhPs+bjiL38RzgltzMDdSZpy89wCfg/8o= =My7w -----END PGP SIGNATURE----- --zUSwb+iZLlPLWCTJ--