unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#74955] [PATCH] services: rootless-podman-service-type: Allow not installing podman.
@ 2024-12-19  0:11 Tomas Volf
       [not found] ` <AM8PR05MB7252209208426CA3F51CE1A4D0022@AM8PR05MB7252.eurprd05.prod.outlook.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Tomas Volf @ 2024-12-19  0:11 UTC (permalink / raw)
  To: 74955; +Cc: Tomas Volf, Ludovic Courtès, Maxim Cournoyer

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





^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#74955] [PATCH] services: rootless-podman-service-type: Allow not installing podman.
       [not found] ` <AM8PR05MB7252209208426CA3F51CE1A4D0022@AM8PR05MB7252.eurprd05.prod.outlook.com>
@ 2024-12-28  1:09   ` Tomas Volf
  2024-12-28 15:22     ` Giacomo Leidi
  0 siblings, 1 reply; 3+ messages in thread
From: Tomas Volf @ 2024-12-28  1:09 UTC (permalink / raw)
  To: Giacomo Leidi; +Cc: Ludovic Courtès, 74955, Maxim Cournoyer

[-- Attachment #1: Type: text/plain, Size: 433 bytes --]

Giacomo Leidi <leidigiacomo@outlook.com> writes:

> Hi Tomas,
>
> Did you consider using define-maybe from (gnu services configuration)? It would
> be somewhat more consistent with the rest of system services imo.

I did.  However setting (package #f) feels more natural to me then
(package %unset-value).  What do you think?  If you insist on using
define-maybe, I will sent v2.

>
> Thank you for your work!
>
> cheers
>
> giacomo

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [bug#74955] [PATCH] services: rootless-podman-service-type: Allow not installing podman.
  2024-12-28  1:09   ` Tomas Volf
@ 2024-12-28 15:22     ` Giacomo Leidi
  0 siblings, 0 replies; 3+ messages in thread
From: Giacomo Leidi @ 2024-12-28 15:22 UTC (permalink / raw)
  To: Tomas Volf; +Cc: Ludovic Courtès, 74955, Maxim Cournoyer

I somehow was convinced you changed also the default value of the 
package field. I know understand why you made this choice, so please 
feel free to disregard my last comment.

Thank you again for you work, I wish you an happy 2025!

giacomo





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-12-28 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-19  0:11 [bug#74955] [PATCH] services: rootless-podman-service-type: Allow not installing podman Tomas Volf
     [not found] ` <AM8PR05MB7252209208426CA3F51CE1A4D0022@AM8PR05MB7252.eurprd05.prod.outlook.com>
2024-12-28  1:09   ` Tomas Volf
2024-12-28 15:22     ` Giacomo Leidi

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).