diff options
| author | Sergio Pastor Pérez <sergio.pastorperez@gmail.com> | 2025-05-02 09:49:49 +0200 |
|---|---|---|
| committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2025-05-02 22:06:26 +0900 |
| commit | 492bbb97000577ab7229246b581a68c242acf8dd (patch) | |
| tree | 34e529f17af8c69f1c4311a070c32f06bebec9e2 /gnu/services | |
| parent | 284c5111db52bf59a165d81a2d3fbd0a51ade598 (diff) | |
services: kwallet: New service.
Change-Id: I1330ce5e1648a8ddf6ddd507255a73335d6baa51
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'gnu/services')
| -rw-r--r-- | gnu/services/desktop.scm | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/gnu/services/desktop.scm b/gnu/services/desktop.scm index a586746cc59..2127c2d389c 100644 --- a/gnu/services/desktop.scm +++ b/gnu/services/desktop.scm | |||
| @@ -20,6 +20,7 @@ | |||
| 20 | ;;; Copyright © 2024 45mg <45mg.writes@gmail.com> | 20 | ;;; Copyright © 2024 45mg <45mg.writes@gmail.com> |
| 21 | ;;; Copyright © 2024 Raven Hallsby <karl@hallsby.com> | 21 | ;;; Copyright © 2024 Raven Hallsby <karl@hallsby.com> |
| 22 | ;;; Copyright © 2025 Jonathan Brielmaier <jonathan.brielmaier@web.de> | 22 | ;;; Copyright © 2025 Jonathan Brielmaier <jonathan.brielmaier@web.de> |
| 23 | ;;; Copyright © 2025 Sergio Pastor Pérez <sergio.pastorperez@gmail.com> | ||
| 23 | ;;; | 24 | ;;; |
| 24 | ;;; This file is part of GNU Guix. | 25 | ;;; This file is part of GNU Guix. |
| 25 | ;;; | 26 | ;;; |
| @@ -197,6 +198,10 @@ | |||
| 197 | gnome-keyring-configuration? | 198 | gnome-keyring-configuration? |
| 198 | gnome-keyring-service-type | 199 | gnome-keyring-service-type |
| 199 | 200 | ||
| 201 | kwallet-configuration | ||
| 202 | kwallet-configuration? | ||
| 203 | kwallet-service-type | ||
| 204 | |||
| 200 | seatd-configuration | 205 | seatd-configuration |
| 201 | seatd-service-type | 206 | seatd-service-type |
| 202 | 207 | ||
| @@ -2148,6 +2153,64 @@ profile, and extends dbus with the ability for @code{efl} to generate | |||
| 2148 | thumbnails and privileges the programs which enlightenment needs to function | 2153 | thumbnails and privileges the programs which enlightenment needs to function |
| 2149 | as expected."))) | 2154 | as expected."))) |
| 2150 | 2155 | ||
| 2156 | |||
| 2157 | ;;; | ||
| 2158 | ;;; kwallet-service-type. | ||
| 2159 | ;;; | ||
| 2160 | |||
| 2161 | (define-record-type* <kwallet-configuration> kwallet-configuration | ||
| 2162 | make-kwallet-configuration | ||
| 2163 | kwallet-configuration? | ||
| 2164 | (wallet kwallet-package (default kwallet-pam)) | ||
| 2165 | (pam-services kwallet-pam-services (default '(("sddm" . login) | ||
| 2166 | ("passwd" . passwd))))) | ||
| 2167 | |||
| 2168 | (define (pam-kwallet config) | ||
| 2169 | "Return a PAM extension for KWallet." | ||
| 2170 | (match config | ||
| 2171 | (#f '()) ;explicitly disabled by user | ||
| 2172 | (_ | ||
| 2173 | (define (%pam-keyring-entry . arguments) | ||
| 2174 | (pam-entry | ||
| 2175 | (control "optional") | ||
| 2176 | (module (file-append (kwallet-package config) | ||
| 2177 | "/lib/security/pam_kwallet5.so")) | ||
| 2178 | (arguments arguments))) | ||
| 2179 | |||
| 2180 | (list | ||
| 2181 | (pam-extension | ||
| 2182 | (transformer | ||
| 2183 | (lambda (service) | ||
| 2184 | (case (assoc-ref (kwallet-pam-services config) | ||
| 2185 | (pam-service-name service)) | ||
| 2186 | ((login) | ||
| 2187 | (pam-service | ||
| 2188 | (inherit service) | ||
| 2189 | (auth (append (pam-service-auth service) | ||
| 2190 | (list (%pam-keyring-entry)))) | ||
| 2191 | (session (append (pam-service-session service) | ||
| 2192 | (list (%pam-keyring-entry "auto_start")))))) | ||
| 2193 | ((passwd) | ||
| 2194 | (pam-service | ||
| 2195 | (inherit service) | ||
| 2196 | (password (append (pam-service-password service) | ||
| 2197 | (list (%pam-keyring-entry)))))) | ||
| 2198 | (else service))))))))) | ||
| 2199 | |||
| 2200 | ;; TODO: consider integrating service in `<plasma-desktop-configuration>' as | ||
| 2201 | ;; done in `<gnome-desktop-configuration>'. This requires rewritting the | ||
| 2202 | ;; `<plasma-desktop-service-type>' as done for `<gnome-desktop-service-type>'. | ||
| 2203 | (define kwallet-service-type | ||
| 2204 | (service-type | ||
| 2205 | (name 'kwallet) | ||
| 2206 | (extensions (list | ||
| 2207 | (service-extension pam-root-service-type pam-kwallet))) | ||
| 2208 | (default-value (kwallet-configuration)) | ||
| 2209 | (description "Return a service that extends PAM with entries using | ||
| 2210 | @code{pam_kwallet5.so}, unlocking the user's login keyring when they log in or | ||
| 2211 | setting its password with @command{passwd}."))) | ||
| 2212 | |||
| 2213 | |||
| 2151 | ;;; | 2214 | ;;; |
| 2152 | ;;; KDE Plasma desktop service. | 2215 | ;;; KDE Plasma desktop service. |
| 2153 | ;;; | 2216 | ;;; |
