Subject: [bug#62699] [PATCH] services: add pam-mount-volume-service-type

From: Ludovic Courtès <[email-masked]>
Date: Sun, 18 Jun 2023 23:20:22 +0200

Hi!

Brian Cully <[email-masked]> skribis:

> The `pam-mount-volumes-service-type' adds additional volumes to the
> pam-mount-service-type in addition to any that are already specified in
> `pam-mount-rules'.
>
> * doc/guix.texi (PAM Mount Volume Service): add documentation for
> `pam-mount-service-type'.
> * gnu/services/pam-mount.scm (extend-pam-mount-configuration): new procedure
> (pam-mount-service-type): allow extension by other service-types
> (field-name->tag): new procedure
> (serialize-string): new procedure
> (integer-or-range?): new procedure
> (serialize-integer-or-range): new procedure
> (serialize-boolean): new procedure
> (pam-mount-volume): new configuration
> (pam-mount-volume->sxml): new procedure
> (pam-mount-volume-rules): new procedure
> (pam-mount-volume-service-type): new procedure
> * Makefile.am: add pam-mount tests
> * tests/services/pam-mount.scm: new tests

This looks useful!

Nitpick: for new files like ‘pam-mount.scm’ in this case, it’s enough to
write “New file” (relief :-)).

I’ve never used PAM mount before so I can only comment on the
implementation and doc (maybe Guillaume is more familiar with it?).

>  Copyright @copyright{} 2022 Antero Mejr@*
>  Copyright @copyright{} 2023 Karl Hallsby
> +Copyright @copyright{} 2023 Brian Cully

Please add @* on the previous line to insert a line break.

> +@item @code{user-id} (type: maybe-integer-or-range)
> +Mount the volume for the user with this ID.  This field may also be
> +specified as a cons cell of @code{(start . end)} indicating a range of

Use the term “pair” rather than “cons cell” (throughout the section),
for consistency with the rest of the manual and to make it more
approachable.

> +(test-end "services-pam-mount")

Neat.

How hard would it be to also have a system tests under (gnu tests …)?
Seems like it would better cover functionality.

Thanks!

Ludo’.