From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id YIGXCWCr62TepQAA9RJhRA:P1 (envelope-from ) for ; Sun, 27 Aug 2023 22:00:32 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id YIGXCWCr62TepQAA9RJhRA (envelope-from ) for ; Sun, 27 Aug 2023 22:00:32 +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 BA149576CF for ; Sun, 27 Aug 2023 22:00:31 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=jRaE19HB; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1693166432; 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: 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=xq/Uz4qj3f5y9Yj1RDe4ZRpU+2pPlU8yFT5r3qwjmj8=; b=C5ZAuXo/BqxjvIQMq+8XO9WaRvTBfoyEIuf60QsX8RmOC1eVONh4yNM3B5Oc13/A0Xok2b JnhpJZpS3Wgbjt5bVXIgywfN0EdaDGNzN5kk8rSmT5B1av2Z5o8zgc9Lqb2chFloqRJqFV eo+LEAePoHbLleZ0WPNdLMai8DUZ20shjLw7GeIjjjRTZ/Y/5F7rR6DYGZRfTlk7GD+KCP EcO1SsCLow1jqYuzVaVznHdW8DezBeqxYltbOUauwfU/1SKaMeFpj49VHlkORkSNoq0zMe PRYeNtv9I2WY0NbWx2kS3mXsuf7SUE60TvCpRdpGu8dH5AmdNAc6JMtd7dokEA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=jRaE19HB; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1693166432; a=rsa-sha256; cv=none; b=TylV1wQQpmpRoTNJfBdpwjo3GvdnPYgOmdKB38aNh3v0OLDFS+qLPVawgqfTb4Kks8tQ4L JtCe+fSJkmec+Yvj4Hdq/QRjmG6UzzrWNOTJMC0fNk+FcbDOn9RVHaAtMalknhLdit5i5i SJ/aDB0CQUSWQaBE7yoXTFCq0W0tRAtn760TUgMSW+9Q6WHlmxT2cdu92NfQezUkAFnDrk /hVEP8VoVLUtFJb+TgwHnJhwYVy7gvvCRtt2NPJZcIMCh8oBzYP4PEN05rrZvdLZ31tq71 +fADzePofusKbql2raFgH06O/d+c6Rt6gXaxrZJHaoC1KSc+6Tg4Ve9Qv7ThRA== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qaLvc-0001pn-QR; Sun, 27 Aug 2023 16:00:08 -0400 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 ) id 1qaLvY-0001mz-Q8 for guix-devel@gnu.org; Sun, 27 Aug 2023 16:00:05 -0400 Received: from mail-lj1-x242.google.com ([2a00:1450:4864:20::242]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qaLvW-0003iZ-Ak for guix-devel@gnu.org; Sun, 27 Aug 2023 16:00:04 -0400 Received: by mail-lj1-x242.google.com with SMTP id 38308e7fff4ca-2bcc14ea414so38882121fa.0 for ; Sun, 27 Aug 2023 13:00:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693166400; x=1693771200; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=xq/Uz4qj3f5y9Yj1RDe4ZRpU+2pPlU8yFT5r3qwjmj8=; b=jRaE19HBHBVNxm6VgEnllJioEKrFo2ZGqfoj/QFQmsTEjJs8WwjZOcb0rHZVTmGEKM 9OIiQyIQhCniyxp4ZuK0xdZCjaIC9rAJiQNKs5Fnl9Va1bAK76jiYIyBsjMSeTzhqAA9 PsMrLjRGoZbFrsdAqTcyyGq9leQ5vXLmgDGomvFtS6RbXtywMO4/PDSZIoR2LaDM08yn jCsDs0W/Iib83Hs9uagff0prw9i6SjXI+OXV0OSYI3fM5exNrFNSgxR4YFNP/I0S3Yha 8vgvVEI5P7py0HttBoQ40jLWS2Kf/qTsSbvjjkDfNApuFTsyjyiIQnIHm0/O1UuoS4Kr qCHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693166400; x=1693771200; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=xq/Uz4qj3f5y9Yj1RDe4ZRpU+2pPlU8yFT5r3qwjmj8=; b=M1zx5scKwEeQ4SdteqQiZRgk4EMBbWao51oe85+QFhn8SZ0sv44CuuwVSL6a63Dya5 oPVBQAsteleNNbE/Xp92RsvmT6dwl03XWuYuNHhFB47N0skna9FoIxdE1I66+QOTXSmG z2WLJosQFTfHK9Lvnds7FquVLHqLK67SZdBS4n0JXqQ8YQEuwYvMrJAqHs99Zb96Qb7M 9e3hzz2gpJpvxhW9KbY65GX5ZwtvcYMWTZytTvAGa4LbF9bJczQwHR9WvnNutOBsLoT6 Pm+YrxpHEZn3Uc9fXhwOG3JzSQiyKqhhf8IcBj4XjoPhog//YWmUi/rC2KE0v55WRvUB 78Aw== X-Gm-Message-State: AOJu0YxFt30Io0icVFSHrzN2nuiKjMB6JzoFWQbyncjWx1WupizcpfJz zd90ymx7bH3x3R+KUI4X1j0VTUWW6/6o3/0J X-Google-Smtp-Source: AGHT+IHi61VMFtcTYKoCG7+/6RMjwLYavx0XADeEHczh3XxFnQ7xP447qWVL+MwbZUs8IZHrWnNfgA== X-Received: by 2002:a05:651c:1213:b0:2bc:dd96:147c with SMTP id i19-20020a05651c121300b002bcdd96147cmr9789261lja.34.1693166400032; Sun, 27 Aug 2023 13:00:00 -0700 (PDT) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id sd26-20020a170906ce3a00b00997d76981e0sm3757821ejb.208.2023.08.27.12.59.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Aug 2023 12:59:59 -0700 (PDT) Message-ID: <99708f26f2d09bbb930371a773732f9c89bb56f2.camel@gmail.com> Subject: Re: Guix CLI options through manifest.scm or guix.scm From: Liliana Marie Prikler To: Distopico , guix-devel@gnu.org Date: Sun, 27 Aug 2023 21:59:57 +0200 In-Reply-To: <87pm38bas8.fsf@riseup.net> References: <87pm38bas8.fsf@riseup.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::242; envelope-from=liliana.prikler@gmail.com; helo=mail-lj1-x242.google.com 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx2.migadu.com X-Migadu-Spam-Score: -9.58 X-Spam-Score: -9.58 X-Migadu-Queue-Id: BA149576CF X-TUID: XgQdDtE3FHbk Hi Distopico Am Sonntag, dem 27.08.2023 um 13:25 -0500 schrieb Distopico: >=20 > Is it possible to define/express CLI options from manifest.scm or > guix.scm? For example, I have CLI options are very broadly scoped. For instance, with transformations, we have a dedicated procedure to turn them into a transformation that can more easily be used inside a manifest. On the general side=E2=80=A6 > ``` > guix shell \ > =C2=A0=C2=A0=C2=A0=C2=A0 -m manifest.scm \ > =C2=A0=C2=A0=C2=A0=C2=A0 --container -F -N -P \ > =C2=A0=C2=A0=C2=A0=C2=A0 --share=3D/opt/android-sdk \ > =C2=A0=C2=A0=C2=A0=C2=A0 --share=3D$HOME/.android/avd \ > =C2=A0=C2=A0=C2=A0=C2=A0 --share=3D$HOME/.gradle/ \ > =C2=A0=C2=A0=C2=A0=C2=A0 --preserve=3D'^DISPLAY$' \ > =C2=A0=C2=A0=C2=A0=C2=A0 --preserve=3D'^XAUTHORITY$' \ > =C2=A0=C2=A0=C2=A0=C2=A0 --preserve=3D'^DBUS_' \ > =C2=A0=C2=A0=C2=A0=C2=A0 --expose=3D$XAUTHORITY \ > =C2=A0=C2=A0=C2=A0=C2=A0 --expose=3D/var/run/dbus > ``` >=20 > Manually invoking this command is not practical, so I have > `scripts/container.sh`, a script to invoke it, but I think it would > be much more practical if it's possible to define it in a > configuration file similar to docker-compose, which allows almost all > CLI options to be set in the configuration file to avoid having an > additional configuration file. >=20 > Or perhaps a Guile script instead of a shell script? How do others > handle this here? =E2=80=A6 every command is available also as a Scheme procedure that takes = its arguments as a list directly. Thus, you can quite easily transform the above to=20 (use-modules (guix script shell)) (guix-shell "-m" "manifest.scm" "--container" "-F" "-N" =E2=80=A6) Of course, if you want to dig deeper, you can also call the functions guix-shell ends up calling, but whether doing so makes sense is up for you to decide. Happy hacking!