diff options
author | Ludovic Courtès <ludo@gnu.org> | 2015-10-29 19:00:14 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2015-10-29 19:07:58 +0100 |
commit | 6726282b20918f98ba7197ea1301376f29a248af (patch) | |
tree | 9355e394a70d538a4cba544e6719444375562dcd /gnu/services/xorg.scm | |
parent | e502bf8953afcd1e0cf29cd729e7c62c5c27792f (diff) | |
download | guix-6726282b20918f98ba7197ea1301376f29a248af.tar guix-6726282b20918f98ba7197ea1301376f29a248af.tar.gz |
services: Add screen-locker service.
* gnu/system/linux.scm (base-pam-services): Remove "xlock" and
"xscreensaver".
* gnu/services/xorg.scm (<screen-locker>): New record type.
(screen-locker-pam-services, screen-locker-setuid-programs,
screen-locker-service): New procedures.
(screen-locker-service-type): New variable.
* gnu/services/desktop.scm (%desktop-services): Use them.
* doc/guix.texi (X Window): Document 'screen-locker-service'.
(Desktop Services): Mention it.
Diffstat (limited to 'gnu/services/xorg.scm')
-rw-r--r-- | gnu/services/xorg.scm | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm index 3a57891a96..639a541777 100644 --- a/gnu/services/xorg.scm +++ b/gnu/services/xorg.scm @@ -32,16 +32,21 @@ #:use-module (gnu packages bash) #:use-module (guix gexp) #:use-module (guix store) + #:use-module (guix packages) #:use-module (guix derivations) #:use-module (guix records) #:use-module (srfi srfi-1) + #:use-module (srfi srfi-9) #:use-module (srfi srfi-26) #:use-module (ice-9 match) #:export (xorg-configuration-file xorg-start-command %default-slim-theme %default-slim-theme-name - slim-service)) + slim-service + + screen-locker-service-type + screen-locker-service)) ;;; Commentary: ;;; @@ -350,4 +355,52 @@ theme." (auto-login-session auto-login-session) (startx startx)))) + +;;; +;;; Screen lockers & co. +;;; + +(define-record-type <screen-locker> + (screen-locker name program empty?) + screen-locker? + (name screen-locker-name) ;string + (program screen-locker-program) ;gexp + (empty? screen-locker-allows-empty-passwords?)) ;Boolean + +(define screen-locker-pam-services + (match-lambda + (($ <screen-locker> name _ empty?) + (list (unix-pam-service name + #:allow-empty-passwords? empty?))))) + +(define screen-locker-setuid-programs + (compose list screen-locker-program)) + +(define screen-locker-service-type + (service-type (name 'screen-locker) + (extensions + (list (service-extension pam-root-service-type + screen-locker-pam-services) + (service-extension setuid-program-service-type + screen-locker-setuid-programs))))) + +(define* (screen-locker-service package + #:optional + (program (package-name package)) + #:key allow-empty-passwords?) + "Add @var{package}, a package for a screen-locker or screen-saver whose +command is @var{program}, to the set of setuid programs and add a PAM entry +for it. For example: + +@lisp +(screen-locker-service xlockmore \"xlock\") +@end lisp + +makes the good ol' XlockMore usable." + (service screen-locker-service-type + (screen-locker program + #~(string-append #$package + #$(string-append "/bin/" program)) + allow-empty-passwords?))) + ;;; xorg.scm ends here |