From 46ec2707a459f376dd72ea6e545662f51157c95e Mon Sep 17 00:00:00 2001 From: David Craven Date: Wed, 20 Jul 2016 13:17:07 +0200 Subject: services: Add kmscon service. * gnu/services/base.scm (, kmscon-service-type): New variables. * doc/guix.texi (@deffn kmscon-service-type, @deftp kmscon-configuration): Add documentation. --- gnu/services/base.scm | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'gnu/services') diff --git a/gnu/services/base.scm b/gnu/services/base.scm index 20a9c3ae11..4c1c481453 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm @@ -39,6 +39,7 @@ #:use-module (gnu packages package-management) #:use-module (gnu packages ssh) #:use-module (gnu packages lsof) + #:use-module (gnu packages terminals) #:use-module ((gnu build file-systems) #:select (mount-flags->bit-mask)) #:use-module (guix gexp) @@ -116,6 +117,11 @@ rngd-configuration? rngd-service-type rngd-service + + kmscon-configuration + kmscon-configuration? + kmscon-service-type + pam-limits-service-type pam-limits-service @@ -1449,6 +1455,43 @@ This service is not part of @var{%base-services}." (service gpm-service-type (gpm-configuration (gpm gpm) (options options)))) +(define-record-type* + kmscon-configuration make-kmscon-configuration + kmscon-configuration? + (kmscon kmscon-configuration-kmscon + (default kmscon)) + (virtual-terminal kmscon-configuration-virtual-terminal) + (login-program kmscon-configuration-login-program + (default #~(string-append #$shadow "/bin/login"))) + (login-arguments kmscon-configuration-login-arguments + (default '("-p"))) + (hardware-acceleration? kmscon-configuration-hardware-acceleration? + (default #f))) ; #t causes failure + +(define kmscon-service-type + (shepherd-service-type + 'kmscon + (lambda (config) + (let ((kmscon (kmscon-configuration-kmscon config)) + (virtual-terminal (kmscon-configuration-virtual-terminal config)) + (login-program (kmscon-configuration-login-program config)) + (login-arguments (kmscon-configuration-login-arguments config)) + (hardware-acceleration? (kmscon-configuration-hardware-acceleration? config))) + + (define kmscon-command + #~(list + (string-append #$kmscon "/bin/kmscon") "--login" + "--vt" #$virtual-terminal + #$@(if hardware-acceleration? '("--hwaccel") '()) + "--" #$login-program #$@login-arguments)) + + (shepherd-service + (documentation "kmscon virtual terminal") + (requirement '(user-processes udev dbus-system)) + (provision (list (symbol-append 'term- (string->symbol virtual-terminal)))) + (start #~(make-forkexec-constructor #$kmscon-command)) + (stop #~(make-kill-destructor))))))) + (define %base-services ;; Convenience variable holding the basic services. -- cgit 1.4.1