From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id gNo/BmtkNmYXpAAAe85BDQ:P1 (envelope-from ) for ; Sat, 04 May 2024 18:38:03 +0200 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id gNo/BmtkNmYXpAAAe85BDQ (envelope-from ) for ; Sat, 04 May 2024 18:38:03 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="Z/GOpXhP"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1714840682; 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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=4pfOoduC+V3A3ZIb13MFIrFmh6EujsURluV+ZQY3ZKc=; b=aNzbgiQ1a3S3nL4lUZy0NcEO0xoEu+l08oQUMwsD1bNZnI971MvFkriRcgtyyMHfhKiB9c ll3P6S8CMUPp4oismCm9OeR5730PMhCZAh08ylvN51Z5QJW+jvYT7tYUF80mGdpqv0eEHR oZZHRhffQEKLPEvKsxAb2bkIuNq3xcYl+cG8tTMyT+7PY78vlAseySHUYC8E9sOu8ZvbrW Wl0Nzqzgci+F6eeS+zv+7a+4PaTY4UlsgHZsUIjljjq9bG07BfeOJvJUMznTlwpplp9rYN p/j0b3Kr2dC4UIzr2tSNh/+U8PBkPxxkY3Vn6ZpFOgDjvkqsS7j0XZzdfoeNjg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b="Z/GOpXhP"; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1714840682; a=rsa-sha256; cv=none; b=G5MoPwr41xGAL+4o/gvNFZfSCu5fupGQjwsQzuGRnVcXaxMcvP2J1po17kZPG45SJK96gN idgwUfQ05uyJPtIOxHn45vBwv26dqir2WxUWVOP75pXaFp4kDrkdN/BUwKW3KfyfD5uLl7 d3EGAQ7Mz8R9+tntaVqzwhPH0ddjpS99+uiw5OgR4pAIY3VdNrd+hbQwt1Rwk/J60g/9ra M7IkUEV952Q2ft0tQH/w/fqxejaKr0ZBSTFVYnteQiz2j8jrBwK/4IYlqLZfMGlHeoTLIv 5CmFPyuho5vb+0k7Ya7PYTGyetL7rmIFAg2OCEnHlyvdZnvN4oJvXnNYC02Etw== 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 C94A33EECE for ; Sat, 4 May 2024 18:38:02 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s3IOL-0005gv-3R; Sat, 04 May 2024 12:37:41 -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 1s3IOJ-0005gk-Ch for guix-patches@gnu.org; Sat, 04 May 2024 12:37:39 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s3IOI-0007fG-Tr for guix-patches@gnu.org; Sat, 04 May 2024 12:37:39 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s3IOf-0002oj-Ty for guix-patches@gnu.org; Sat, 04 May 2024 12:38:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#70265] Add docker cli Guix Home service and some docker authentication plugins Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 04 May 2024 16:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70265 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Giacomo Leidi Cc: 70265@debbugs.gnu.org, Andrew Tropin , Tanguy Le Carrour , paren@disroot.org Received: via spool by 70265-submit@debbugs.gnu.org id=B70265.171484063610812 (code B ref 70265); Sat, 04 May 2024 16:38:01 +0000 Received: (at 70265) by debbugs.gnu.org; 4 May 2024 16:37:16 +0000 Received: from localhost ([127.0.0.1]:54571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3INv-0002oK-Aj for submit@debbugs.gnu.org; Sat, 04 May 2024 12:37:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50840) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s3INs-0002oC-RO for 70265@debbugs.gnu.org; Sat, 04 May 2024 12:37:14 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s3INP-0007ZG-2p; Sat, 04 May 2024 12:36:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=4pfOoduC+V3A3ZIb13MFIrFmh6EujsURluV+ZQY3ZKc=; b=Z/GOpXhP9B+AbitsPwvS VBD1vvcAhnY3yHYiPavo3MVCAeXB0I+B+717HxcYIFRkA/aA+/gzQKg34GHcFTOcnkaQbgPWt0eJK SXY6fUOvcNNwhFnAbjgmfShQd71JM/aIks72TmAwQOjV8WTBBgnNPwxfr5jjgrU13i4M0aR4LNpaj TNZVc+hRk0Q8UQHKAaFfF5P6E/P1yobEKA98BPi6hDE+DwUdlqSH8M2xcOtjvueZq7Vm8wmIyY6mm t+B5vDVUtW58pHsCra5QSxqJb1oaOqySl4nDEfe4dvbwXSm7oG1IHNsaZ+r+98qiTEJLXgLXYBTiw 3lCnIVIZPBfN4g==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <814c5c6c8ba59b4069966f46c995e7a8fd0d9b88.1712523439.git.goodoldpaul@autistici.org> (Giacomo Leidi's message of "Sun, 7 Apr 2024 22:57:19 +0200") References: <95e5c6e85e09ead19a43fc37612d62bc91a64048.1712523439.git.goodoldpaul@autistici.org> <814c5c6c8ba59b4069966f46c995e7a8fd0d9b88.1712523439.git.goodoldpaul@autistici.org> Date: Sat, 04 May 2024 18:36:14 +0200 Message-ID: <87a5l5ttz5.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -7.09 X-Spam-Score: -7.09 X-Migadu-Queue-Id: C94A33EECE X-Migadu-Scanner: mx13.migadu.com X-TUID: SiJrOXWRmYae Hi, Giacomo Leidi skribis: > * gnu/home/services/containers.scm (home-docker-cli-service-type): New > variable; > * doc/guix.texi: document it; > * gnu/local.mk: add it. Nice. For the documentation part, the convention is something like: * doc/guix.texi (Miscellaneous Services)[Container Services]: New heading. > +@cindex docker cli service, for Home s/docker cli/Docker command-line interface/ > +The @code{(gnu home services containers)} module provides the following = service: > + > +@defvar home-docker-cli-service-type > +This service allows for configuring the Docker command line interface, f= or > +example to make it aware of Guix provided plugins. > +@end defvar > + > +For example, you can use it like this to make Docker safely store your r= egistry > +credentials with the system > +@uref{https://wiki.gnome.org/Projects/Libsecret, libsecret} compatible S= ecret service: Rather: @uref{https://wiki.gnome.org/Projects/Libsecret, libsecret-compatible} secret service: (So that the parenthesized URL appears in the right place in Info and PDF.) > +@lisp > +(use-modules (gnu packages docker)) > + > +(service home-docker-cli-service-type > + (docker-cli-configuration > + (creds-store "secretservice") > + (cli-plugins > + (list docker-credential-secretservice)) > + (extra-content ", \"auths\": @{\"https://index.docker.io/v1/\= ": @{@}@}"))) Sounds scary: how can I know as a user where that comma is going to be stuck in the resulting file? Providing partial JSON strings should rather be avoided IMO. Also, if that part is necessary, it should be explained. > +(define (format-name name) > + (define without-dashes (string-replace-substring (symbol->string name)= "-" " ")) > + (define splitted (string-split without-dashes #\space)) > + (string-replace-substring > + (apply string-append > + `(,(car splitted) > + ,@(map string-capitalize (cdr splitted)))) > + " " "")) Rather: (match split ;past participate of =E2=80=9Cto split=E2=80=9D ((head . rest) (string-concatenate (cons head (map string-capitalize rest))))) See for the rationale. > +(define docker-cli-configuration->json-fields > + (lambda (config) > + (filter (compose not (lambda (f) (or (null? f) (and (string? f) (str= ing-null? f))))) > + (map (lambda (f) To improve readability, I=E2=80=99d make it: (filter-map (lambda (f) (match f (() #f) ("" #f) (_ =E2=80=A6))) docker-cli-configuration-fields) > +(define (home-docker-cli-configuration-file config) > + `((".docker/config.json" > + ,(computed-file "docker-cli-config.json" > + #~(with-output-to-file #$output > + (lambda _ > + (display > + (string-append "{" > + (string-join (list #$@(docker-cli-configura= tion->json-fields config)) ",") > + #$(docker-cli-configuration-extra-content c= onfig) I think the comma should be automatically added when =E2=80=98extra-content= =E2=80=99 is non-empty. A more general question: do you think this particular example (libsecret plugin) could be solved in another way without involving Home? (For example by having a plugin search path in the package.) Do you have other use cases in mind? The reason I=E2=80=99m asking is that it feels heavyweight for what looks l= ike =E2=80=9Cbasic=E2=80=9D Docker configuration. But maybe Docker is like thi= s and a Home service is what it takes to make it more easily configurable (I=E2=80=99m n= ot really familiar with Docker), in which case I=E2=80=99m all for this patch series! Thanks, Ludo=E2=80=99.