summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/guix.texi5
-rw-r--r--gnu/services/base.scm15
2 files changed, 20 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index dd6af80965..c68e2915d1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4745,6 +4745,11 @@ passed to @command{guix-daemon}.
 Run @var{udev}, which populates the @file{/dev} directory dynamically.
 @end deffn
 
+@deffn {Monadic Procedure} console-keymap-service @var{file}
+Return a service to load console keymap from @var{file} using
+@command{loadkeys} command.
+@end deffn
+
 
 @node Networking Services
 @subsubsection Networking Services
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index d0a2e8c848..697b9395c2 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -46,6 +47,7 @@
             swap-service
             user-processes-service
             host-name-service
+            console-keymap-service
             console-font-service
             udev-service
             mingetty-service
@@ -313,6 +315,19 @@ stopped before 'kill' is called."
           (else
            (zero? (cdr (waitpid pid))))))))
 
+(define (console-keymap-service file)
+  "Return a service to load console keymap from @var{file}."
+  (with-monad %store-monad
+    (return
+     (service
+      (documentation
+       (string-append "Load console keymap (loadkeys)."))
+      (provision '(console-keymap))
+      (start #~(lambda _
+                 (zero? (system* (string-append #$kbd "/bin/loadkeys")
+                                 #$file))))
+      (respawn? #f)))))
+
 (define* (console-font-service tty #:optional (font "LatGrkCyr-8x16"))
   "Return a service that sets up Unicode support in @var{tty} and loads
 @var{font} for that tty (fonts are per virtual console in Linux.)"