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

  • Done
  • quality assurance status badge
Details
4 participants
  • Giacomo Leidi
  • Ludovic Courtès
  • Maxim Cournoyer
  • Tomas Volf
Owner
unassigned
Submitted by
Tomas Volf
Severity
normal

Debbugs page

Tomas Volf wrote 3 months ago
(address . guix-patches@gnu.org)(name . Tomas Volf)(address . ~@wolfsden.cz)
de2ca6114d6448a43223c7923f5ceae9b482e101.1734567063.git.~@wolfsden.cz
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(-)

Toggle diff (50 lines)
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
Giacomo Leidi wrote 3 months ago
AM8PR05MB7252209208426CA3F51CE1A4D0022@AM8PR05MB7252.eurprd05.prod.outlook.com
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.

Thank you for your work!

cheers

giacomo
Attachment: file
Tomas Volf wrote 2 months ago
(name . Giacomo Leidi)(address . leidigiacomo@outlook.com)
87y1003963.fsf@wolfsden.cz
Giacomo Leidi <leidigiacomo@outlook.com> writes:

Toggle quote (5 lines)
> 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.

Toggle quote (6 lines)
>
> Thank you for your work!
>
> cheers
>
> giacomo
-----BEGIN PGP SIGNATURE-----

iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmdvT9QOHH5Ad29sZnNk
ZW4uY3oACgkQL7/ufbZ/wamzsw/+LIgUGJqxta5MbANRGnTtMR1nglCmq48oZTUV
ETiM1l6EY5Q9SKRH+I2ioC2MrhdEuNBmp6UYxMGsXqw4mHoenu3YV2+u9+0Ax4Ip
Fp4zX5ddYDRRIEq22n/PTSbyM7r44Nm7OtVbDOSo672//oAW2WNREvzU6nS4wfh9
+YGV0hNs/w8wWKhJQtvZWzx7sHKRYZQ07lCtrZQZONcg5IHZxLX1LKe4llEMeiZA
v5cNTk7WUE/f1e8l4w/m1NV6jSOfIy/NqgV+48e5Vg+rD/8LZIcA+deoDM5wkikj
NFGfcIKkVzAypo+tSABH4SBg6eO7K4nXkOo4fVLj4JOxvDAhJXY3DdizxuHYPyo1
LooNInribKZ3FIpwbdIzloc2sdhPol4ZhN590i45rfbt2vMH3CljN9jrAxsjeFOo
ykcexhWSmy8/52DQD0+VuWZyQU2lmefdEh1k67xnCJ6AWrfK8x+ecpRfPvyI2nh/
Bbt7uObl8Vo5s4szURtfiYkdLeG1bJ1Lh9rSks+GJGWp1gKUk39gm/rDSyXvpFKG
qnh6C67Le6JbjaPVXX6pWrdRhLB4p8WvdgVd73Y6miHTLMxj6kfjLNX02dMnKD8k
NIQ80IxpvySDbQ0LNDTOyIPNiqL3SMdICYKYBnPLNztNefN1InnOXpFBCCRaD0Qj
aFBm39I=
=Nnm+
-----END PGP SIGNATURE-----

Giacomo Leidi wrote 2 months ago
(name . Tomas Volf)(address . ~@wolfsden.cz)
AM8PR05MB725280D63511A7C24F059CE8D00F2@AM8PR05MB7252.eurprd05.prod.outlook.com
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
Maxim Cournoyer wrote 2 months ago
(name . Tomas Volf)(address . ~@wolfsden.cz)
87h66ngl16.fsf@gmail.com
Tomas Volf <~@wolfsden.cz> writes:

Toggle quote (11 lines)
> 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

Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>

--
Thanks,
Maxim
Ludovic Courtès wrote 2 months ago
(name . Tomas Volf)(address . ~@wolfsden.cz)
874j2c7zla.fsf@gnu.org
Tomas Volf <~@wolfsden.cz> skribis:

Toggle quote (11 lines)
> 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'.
Toggle diff (16 lines)
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
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 74955@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 74955
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help