diff mbox series

[bug#49969,v2,4/7] gnu: admin: Add greetd-pam-mount

Message ID 20210810200756.9581-4-mail@muradm.net
State Accepted
Headers show
Series gnu: desktop: Add seatd-service-type and greetd-service-type | expand

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

muradm Aug. 10, 2021, 8:07 p.m. UTC
This package inherits pam-mount in the way that it is compiled
specifically for use with greetd daemon. It uses different
configuration location and name space for storing data in PAM.

greetd-pam-mount is used in configuration of greetd to provide
auto-(mounting/unmounting) of XDG_RUNTIME_DIR in the way that
it will not interfere with default pam-mount configuration.

* gnu/packages/admin.scm (greetd-pam-mount): Add greetd-pam-mount
---
 gnu/packages/admin.scm | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

Comments

Xinglu Chen Aug. 11, 2021, 11:32 a.m. UTC | #1
On Tue, Aug 10 2021, muradm wrote:

> This package inherits pam-mount in the way that it is compiled
> specifically for use with greetd daemon. It uses different
> configuration location and name space for storing data in PAM.
>
> greetd-pam-mount is used in configuration of greetd to provide
> auto-(mounting/unmounting) of XDG_RUNTIME_DIR in the way that
> it will not interfere with default pam-mount configuration.

It might be a good idea to put this in a comment in the code too.  :-)

> * gnu/packages/admin.scm (greetd-pam-mount): Add greetd-pam-mount
> ---
>  gnu/packages/admin.scm | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
> index eda269f148..e805b219c5 100644
> --- a/gnu/packages/admin.scm
> +++ b/gnu/packages/admin.scm
> @@ -42,6 +42,7 @@
>  ;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz>
>  ;;; Copyright © 2021 WinterHound <winterhound@yandex.com>
>  ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
> +;;; Copyright © 2021 muradm <mail@muradm.net>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -4247,6 +4248,25 @@ supports.  It can also mount encrypted LUKS volumes using the password
>  supplied by the user when logging in.")
>      (license (list license:gpl2+ license:lgpl2.1+))))
>  
> +(define-public greetd-pam-mount
> +  (package
> +    (inherit pam-mount)
> +    (name "greetd-pam-mount")
> +    (arguments
> +     (substitute-keyword-arguments (package-arguments pam-mount)
> +       ((#:configure-flags flags ''())
> +        `(cons* "--with-rundir=/run/greetd" ,flags))
> +       ((#:phases phases)
> +        `(modify-phases ,phases
> +           (add-after 'unpack 'patch-config-file-name
> +             (lambda* (#:key inputs #:allow-other-keys)
> +               (substitute* "src/pam_mount.c"
> +                 ((".*define CONFIGFILE .*$")
> +                  "#define CONFIGFILE \"/etc/security/greetd_pam_mount.conf.xml\"\n")
> +                 (("pam_mount_config") "greetd_pam_mount_config")
> +                 (("pam_mount_system_authtok") "greetd_pam_mount_system_authtok"))))))))
> +    (synopsis "pam-mount specifically compiled for use with greetd")))

The description should also be updated.
muradm Aug. 11, 2021, 8:15 p.m. UTC | #2
Noted for next update, thanks

Xinglu Chen <public@yoctocell.xyz> writes:

> On Tue, Aug 10 2021, muradm wrote:
>
>> This package inherits pam-mount in the way that it is compiled
>> specifically for use with greetd daemon. It uses different
>> configuration location and name space for storing data in PAM.
>>
>> greetd-pam-mount is used in configuration of greetd to provide
>> auto-(mounting/unmounting) of XDG_RUNTIME_DIR in the way that
>> it will not interfere with default pam-mount configuration.
>
> It might be a good idea to put this in a comment in the code 
> too.  :-)
>
>> * gnu/packages/admin.scm (greetd-pam-mount): Add 
>> greetd-pam-mount
>> ---
>>  gnu/packages/admin.scm | 20 ++++++++++++++++++++
>>  1 file changed, 20 insertions(+)
>>
>> diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
>> index eda269f148..e805b219c5 100644
>> --- a/gnu/packages/admin.scm
>> +++ b/gnu/packages/admin.scm
>> @@ -42,6 +42,7 @@
>>  ;;; Copyright © 2021 David Larsson 
>>  <david.larsson@selfhosted.xyz>
>>  ;;; Copyright © 2021 WinterHound <winterhound@yandex.com>
>>  ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
>> +;;; Copyright © 2021 muradm <mail@muradm.net>
>>  ;;;
>>  ;;; This file is part of GNU Guix.
>>  ;;;
>> @@ -4247,6 +4248,25 @@ supports.  It can also mount encrypted 
>> LUKS volumes using the password
>>  supplied by the user when logging in.")
>>      (license (list license:gpl2+ license:lgpl2.1+))))
>>
>> +(define-public greetd-pam-mount
>> +  (package
>> +    (inherit pam-mount)
>> +    (name "greetd-pam-mount")
>> +    (arguments
>> +     (substitute-keyword-arguments (package-arguments 
>> pam-mount)
>> +       ((#:configure-flags flags ''())
>> +        `(cons* "--with-rundir=/run/greetd" ,flags))
>> +       ((#:phases phases)
>> +        `(modify-phases ,phases
>> +           (add-after 'unpack 'patch-config-file-name
>> +             (lambda* (#:key inputs #:allow-other-keys)
>> +               (substitute* "src/pam_mount.c"
>> +                 ((".*define CONFIGFILE .*$")
>> +                  "#define CONFIGFILE 
>> \"/etc/security/greetd_pam_mount.conf.xml\"\n")
>> +                 (("pam_mount_config") 
>> "greetd_pam_mount_config")
>> +                 (("pam_mount_system_authtok") 
>> "greetd_pam_mount_system_authtok"))))))))
>> +    (synopsis "pam-mount specifically compiled for use with 
>> greetd")))
>
> The description should also be updated.
diff mbox series

Patch

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index eda269f148..e805b219c5 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -42,6 +42,7 @@ 
 ;;; Copyright © 2021 David Larsson <david.larsson@selfhosted.xyz>
 ;;; Copyright © 2021 WinterHound <winterhound@yandex.com>
 ;;; Copyright © 2021 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2021 muradm <mail@muradm.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4247,6 +4248,25 @@  supports.  It can also mount encrypted LUKS volumes using the password
 supplied by the user when logging in.")
     (license (list license:gpl2+ license:lgpl2.1+))))
 
+(define-public greetd-pam-mount
+  (package
+    (inherit pam-mount)
+    (name "greetd-pam-mount")
+    (arguments
+     (substitute-keyword-arguments (package-arguments pam-mount)
+       ((#:configure-flags flags ''())
+        `(cons* "--with-rundir=/run/greetd" ,flags))
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'unpack 'patch-config-file-name
+             (lambda* (#:key inputs #:allow-other-keys)
+               (substitute* "src/pam_mount.c"
+                 ((".*define CONFIGFILE .*$")
+                  "#define CONFIGFILE \"/etc/security/greetd_pam_mount.conf.xml\"\n")
+                 (("pam_mount_config") "greetd_pam_mount_config")
+                 (("pam_mount_system_authtok") "greetd_pam_mount_system_authtok"))))))))
+    (synopsis "pam-mount specifically compiled for use with greetd")))
+
 (define-public jc
   (package
     (name "jc")