From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id OHyRHlVXMGOhUgAAbAwnHQ (envelope-from ) for ; Sun, 25 Sep 2022 15:27:49 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uPWiHVVXMGOmXQEAG6o9tA (envelope-from ) for ; Sun, 25 Sep 2022 15:27:49 +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 26A054323D for ; Sun, 25 Sep 2022 15:27:49 +0200 (CEST) Received: from localhost ([::1]:49020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ocRfg-00088R-CH for larch@yhetil.org; Sun, 25 Sep 2022 09:27:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50240) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocRf7-00084t-OD for help-guix@gnu.org; Sun, 25 Sep 2022 09:27:13 -0400 Received: from relay12.mail.gandi.net ([2001:4b98:dc4:8::232]:57781) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ocRf5-0006ka-Sn for help-guix@gnu.org; Sun, 25 Sep 2022 09:27:13 -0400 Received: (Authenticated sender: me@fabionatali.com) by mail.gandi.net (Postfix) with ESMTPSA id D7C50200005; Sun, 25 Sep 2022 13:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fabionatali.com; s=gm1; t=1664112428; h=from:from: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; bh=Z7FR6GbM4aSQiEjOBCYgqUrgjIHhKLx+vcEIRVoP5yU=; b=iPPU28pK6N5DTiZTk0rq34nLjpZOR+5MmTlnGs91ALDiJuYzbYBCv146GbrnM1o8t5EZMh LV+M727RIm5Z0d/Sm8QH7YV2IgBgimP0YWVtuH6fzSNBIhxzMWL1gZD6isHt/SLnCoYCv4 BN1nq1+hwlCvmH+gAPEAGXyMT5nqOTlHXgzW5JnoMw/MLOZ9OsO86hnpLY/PvVxBwC3H9i RmdEM/ssI376gCNSyQW5WhvJYLVLOilPPrD/r7EFQtB9vkphxgZtQQuvcGrEmvdQ8DvHGC rp/w6GPeWt3WaQ20Us5/MDCRsKIMDto+uX6RxqxU9MLw8gs30dEtEltzhk0jhQ== From: Fabio Natali To: Trev , help-guix@gnu.org Subject: Re: Guix Home, .local/bin executable scripts In-Reply-To: <874jww2xse.fsf@codinator.mail-host-address-is-not-set> References: <87r100czb9.fsf@reckondigital.com> <874jww2xse.fsf@codinator.mail-host-address-is-not-set> Date: Sun, 25 Sep 2022 14:27:05 +0100 Message-ID: <87illby47q.fsf@reckondigital.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:4b98:dc4:8::232; envelope-from=me@fabionatali.com; helo=relay12.mail.gandi.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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" 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=1664112469; h=from:from:sender:sender: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:dkim-signature; bh=Z7FR6GbM4aSQiEjOBCYgqUrgjIHhKLx+vcEIRVoP5yU=; b=t/FOWOWyFKz1wz3jmuDKTmVuXZ+Vy2p6j1TuJXBGNfixsh2xgzbxw9d4xtaYKJ7+zoxdxM WDkZVpPWF+MlmzLUhZp+JR5rxe4ONDqSQv5wj1Zr6SjtMXWO1bxye/N3N0urOmRYuhnXqa p4jNvH8+WZCQN6hyA8lYj2P0f6yV4QzKFp+TD038e3EIcbeFO250HzLG7OgCZPkEKWBSMl IkYkNd5zhnaiIBrnfRwWxgkhvJPrQsd1Ngd9XLSS1P1c/X0CLdrZSLwwjFzgx/0JdG/RKG wm/epWuZq5oUhbYt+khe0ajvCLoPh8xXBlTxkw0iSwZ5LTVjIKplTOdOuiIBhw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664112469; a=rsa-sha256; cv=none; b=CXLkOV/e/PyzWKUgM1VyWHPpUB2BAIp9o6lkVTzflZX9y2Wt4oc7AtjgN3Nxoaf7G5Hi7H DYGyp6kO9eOHqlvWUtycQu6QtCjdZ3OkwWQQFlANRzBBotvGBGAf+uEG6j6/Tp0YFx5nPS 5Cd1iI1qa4f6gyUwei9GQbaoobIDZh6bsP0XdIaAn2QSjsFNPMBeSc6VuHF0Bb8DQ4PAKZ Pmd+8a9CCziCGvnM9v+uSGcxehUhbn5pNUod2OxR+eAH3lD1QYqayZpjAHsHJ3YwJHJVrg p1iJw2ky12CLtZjplFFLRroFYe/4+f+srw1iMvXRcV0O1fu4IlDccZ+xl0C0SA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=fabionatali.com header.s=gm1 header.b=iPPU28pK; dmarc=none; 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: -1.95 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fabionatali.com header.s=gm1 header.b=iPPU28pK; dmarc=none; 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: 26A054323D X-Spam-Score: -1.95 X-Migadu-Scanner: scn1.migadu.com X-TUID: JTAliLIVPlFt Hey Trev, Thanks for your help! On 2022-09-24, 15:49 -0700, Trev wrote: > If the thing is being moved to your store for any reason you may want > to explicitly update the permissions. I had to do this when I > packaged PHP composer for personal use. Things tend to go into the > store as read-only. I see, yes, I followed your advice and ended up adding an explicit `chmod' command. > You can patch a shebang or anything else with substitute by doing the > following from within a gexp where #$bash happens to be the bash > package reference so long as it is in the right lexical scope. See > (with-imported-modules) in the manual. > > (substitute* "scripts/hello.sh" > ("#!/bin/bash" (string-append #$bash "/bin/bash"))) This was a great starting point. Thanks to this and some fantastic support on IRC, I was able to get to this working version: ,---- | (define my/home-hello-service | (service | home-files-service-type | `((".local/bin/hello.sh" | ,(computed-file | "hello.sh" | (with-imported-modules | '((guix build utils)) | #~(begin | (use-modules (guix build utils)) | (copy-file #$(local-file "scripts/hello.sh") #$output) | (substitute* | #$output (("/bin/bash") #$(file-append bash-minimal "/bin/bash"))) | (chmod #$output #o555)))))))) `---- It was quite a learning curve, but I'm happy I got that working. Thanks, best, Fabio.