Subject: bug#74955: closed (Re: [bug#74955] [PATCH] services: rootless-podman-service-type: Allow not installing podman.)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 06 Jan 2025 15:06:02 +0000

Your bug report

#74955: [PATCH] services: rootless-podman-service-type: Allow not installing podman.

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
74955: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74955
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#74955] [PATCH] services: rootless-podman-service-type: Allow not installing podman.
From: Ludovic Courtès <[email-masked]>
To: Tomas Volf <[email-masked]>
Cc: Giacomo Leidi <[email-masked]>, [email-masked], Maxim Cournoyer <[email-masked]>
Date: Mon, 06 Jan 2025 16:04:49 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Tomas Volf <[email-masked]> skribis:

> Sometimes you would want to skip on actually installing the podman package in
> order to save disk space and bandwidth.  Even without installing it globally,
> podman can still be fetched via guix shell when required.
>
> * gnu/services/containers.scm (package-or-#f?): New procedure.
> (rootless-podman-configuration)<podman>: Change type to package-or-#f.
> (rootless-podman-service-profile): Produce empty list if not podman package.
> * doc/guix.texi (Miscellaneous Services): Document the change.
>
> Change-Id: If533d913ea190558ce7e206d98ada4d805270594

Applied with the change below.

Thanks everyone!

Ludo'.

diff --git a/doc/guix.texi b/doc/guix.texi
index 22cea4e5d2..caebe3b03c 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -41424,9 +41424,9 @@ Miscellaneous Services
 Available @code{rootless-podman-configuration} fields are:
 
 @table @asis
-@item @code{podman} (default: @code{podman}) (type: package-of-#f)
+@item @code{podman} (default: @code{podman}) (type: package-or-#f)
 The Podman package that will be installed in the system profile.
-@code{#f} can be passed to suppress the installation.
+Pass @code{#f} to not install Podman.
 
 @item @code{group-name} (default: @code{"cgroup"}) (type: string)
 The name of the group that will own /sys/fs/cgroup resources.  Users that

Subject: [PATCH] services: rootless-podman-service-type: Allow not installing podman.
From: Tomas Volf <[email-masked]>
To: [email-masked]
Cc: Tomas Volf <[email-masked]>
Date: Thu, 19 Dec 2024 01:11:03 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Sometimes you would want to skip on actually installing the podman package in
order to save disk space and bandwidth.  Even without installing it globally,
podman can still be fetched via guix shell when required.

* gnu/services/containers.scm (package-or-#f?): New procedure.
(rootless-podman-configuration)<podman>: Change type to package-or-#f.
(rootless-podman-service-profile): Produce empty list if not podman package.
* doc/guix.texi (Miscellaneous Services): Document the change.

Change-Id: If533d913ea190558ce7e206d98ada4d805270594
---
 doc/guix.texi               |  3 ++-
 gnu/services/containers.scm | 13 +++++++++----
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index f7b7569887..36bab360b4 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -41369,8 +41369,9 @@ Miscellaneous Services
 Available @code{rootless-podman-configuration} fields are:
 
 @table @asis
-@item @code{podman} (default: @code{podman}) (type: package)
+@item @code{podman} (default: @code{podman}) (type: package-of-#f)
 The Podman package that will be installed in the system profile.
+@code{#f} can be passed to suppress the installation.
 
 @item @code{group-name} (default: @code{"cgroup"}) (type: string)
 The name of the group that will own /sys/fs/cgroup resources.  Users that
diff --git a/gnu/services/containers.scm b/gnu/services/containers.scm
index 03f0649c0d..a3cdead0c3 100644
--- a/gnu/services/containers.scm
+++ b/gnu/services/containers.scm
@@ -63,10 +63,15 @@ (define list-of-pam-limits-entries?
 (define list-of-subid-ranges?
   (list-of subid-range?))
 
+(define (package-or-#f? val)
+  (or (not val)
+      (package? val)))
+
 (define-configuration/no-serialization rootless-podman-configuration
   (podman
-   (package podman)
-   "The Podman package that will be installed in the system profile.")
+   (package-or-#f podman)
+   "The Podman package that will be installed in the system profile.
+@code{#f} can be passed to suppress the installation.")
   (group-name
    (string "cgroup")
    "The name of the group that will own /sys/fs/cgroup resources.  Users that
@@ -106,8 +111,8 @@ (define-configuration/no-serialization rootless-podman-configuration
 
 (define rootless-podman-service-profile
   (lambda (config)
-    (list
-     (rootless-podman-configuration-podman config))))
+    (or (and=> (rootless-podman-configuration-podman config) list)
+        (list))))
 
 (define rootless-podman-service-etc
   (lambda (config)
-- 
2.46.0