From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id AJBAGwUxJ2KcigAAgWs5BA (envelope-from ) for ; Tue, 08 Mar 2022 11:33:41 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id iAW0EwUxJ2JcGQAAG6o9tA (envelope-from ) for ; Tue, 08 Mar 2022 11:33:41 +0100 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 04224220C6 for ; Tue, 8 Mar 2022 11:33:40 +0100 (CET) Received: from localhost ([::1]:51958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nRX9v-0004JP-S2 for larch@yhetil.org; Tue, 08 Mar 2022 05:33:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:57470) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRX9b-0004Hy-AX for help-guix@gnu.org; Tue, 08 Mar 2022 05:33:19 -0500 Received: from [2001:470:142:3::e] (port=35850 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRX9b-0003qB-1A; Tue, 08 Mar 2022 05:33:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=2Zgxla5M15EJMatZO2wSr0/G7c82id0PGGsgyX+8R2Q=; b=YDDjeVc64BYFhJMwlDhy Wu7rkd2y772kOWlCr456ljDiQAQZXR1y2RybIomEYTl0Q5xMk9LPrIbrYk+yRT/yhr7vPGzkTjWds iNJ6x9E02Y/lsvL7O7N7COpCCmQCOc7qWFVrBVbked6tZv2VQVG1gLi2ycyUuVtZdY5RmHMZ+E9Bx lQKMVx/3gUPwgdiTmhL5SZdh5mhP6h5EqQjbBTnI1f8Yleyk0VTkC8D2ZNvYEH9Yu/a5CZTwS/Vwm b5mckdwkAXyNrlF8LHphFtizPFfe2HHZvV9prdoExMSoYp/DkTZZCdBAs2tuLyaGf3FybPk2WOS5E R+qglXhgkO8Tjw==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=38504 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nRX9a-0006AQ-JU; Tue, 08 Mar 2022 05:33:18 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Reza Housseini Subject: Re: Run a system command in home configuration file References: X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 18 =?utf-8?Q?Vent=C3=B4se?= an 230 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Tue, 08 Mar 2022 11:33:17 +0100 In-Reply-To: (Reza Housseini's message of "Fri, 25 Feb 2022 11:08:23 +0100") Message-ID: <87bkyg7mz6.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , Cc: help-guix@gnu.org Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1646735621; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=2Zgxla5M15EJMatZO2wSr0/G7c82id0PGGsgyX+8R2Q=; b=RAL9fZD7dp9FwQgypd1TQR9sjCozD+htnoIMAfOSrS/k41HE4pikGAOeVWaaGzhXYIJa1Z AbIDYK6BvuRK6r9FEGigaB3UZqPfh74saVkbHHMSOrWZcTW6u+NQJLXavlu8JbvdFQyUli bMwOHOn0146v+9jxHmFvNoh2b9p7QcTbfbN8d0e/74pNML6G/mznbHaQUkq0Tk3J2KPCuu FCO59QfCWriNmup+OiUae/6fnHD1bXCBoq++TNWaZklb3c1q/8OwmGbIaXXrFk7zJU5YOy NORei9V5pUWwHvAcQ4QtBSemblpkayjg0zkQlw/q6GxgwI7aMre9sz3L2vVLUw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646735621; a=rsa-sha256; cv=none; b=s8XtZGKdTHGcZWzCu5aTWSZk7TaMf+ABtXjGMGrXdU386La3ZJohM3C+K7pZPjRR7Sg7PO GV1x0y/bLZ8Qpq80Qieq9txYHHbTB8H5WxVzoJ+VVQLkd0m/NxwbtWgH1pF26Ib08irQfe pKtrg/ziEBBQtWVIyXtNJfNVDU1OeycqgQU8yrE4rwf7A83iqZFuF3N+BtiDC14VEz/7fR ysh461wef1vYwyyuFxLC0f+pyNNz5PY0kzbeu8ML/Cs3o87b6lgWZb3jNBup0EmaPgTB3u I/Z+EGV+yihWkhB/bdNblhnEaW9POFw38ZvlXq/QJTgAnMDS5MRxbCXCNShd3g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=YDDjeVc6; 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: -7.92 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=YDDjeVc6; 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: 04224220C6 X-Spam-Score: -7.92 X-Migadu-Scanner: scn0.migadu.com X-TUID: vbkgApsQnbUH Hi, Reza Housseini skribis: > I want to run a system command and use the output inside my ssh config > file. Below is the service configuration I'm talking about and my current > implementation which does not work, probably because the command is run > from the daemon, but I need it to run from the current user. Has anyone an > idea how to achieve this? > > (simple-service 'ssh-config > home-files-service-type > (list `("ssh/config" > ,(mixed-text-file "config" " > Host * > IdentityAgent " #~(system* #$(file-append gnupg "/bin/gpgconf") > "--list-dirs" "agent-ssh-socket") " > ")))) Instead of #~(system* =E2=80=A6) above, you could do something like: (let* ((pipe (open-input-pipe "gpgconf" =E2=80=A6)) (data (get-string-all pipe))) (close-pipe pipe) data) The effect will be that =E2=80=98gpgconf=E2=80=99 will run when you invoke = =E2=80=98guix system reconfigure=E2=80=99, as the user who invokes it. (You need the (ice-9 pop= en) and (rnrs io bytevectors) modules.) I can=E2=80=99t necessarily recommend it because it=E2=80=99s kinda wild, b= ut it should do the trick. HTH, Ludo=E2=80=99.