Subject: [bug#37717] [PATCH 3/3] gnu: Add kmonad.

From: "Alex Griffin" <[email-masked]>
Date: Sat, 12 Oct 2019 19:38:10 +0000

This patch adds KMonad. A KMonad service is probably in order at some point, because to avoid running it as root you need to set up group permissions and udev rules.
-- 
Alex Griffin

From c3256cb46c227438ce30dfc2b89a723b367b5d23 Mon Sep 17 00:00:00 2001
From: Alex Griffin <[email-masked]>
Date: Sat, 12 Oct 2019 13:55:49 -0500
Subject: [PATCH 3/3] gnu: Add kmonad.

* gnu/packages/haskell-apps.scm (kmonad): New variable.
---
 gnu/packages/haskell-apps.scm | 46 +++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/gnu/packages/haskell-apps.scm b/gnu/packages/haskell-apps.scm
index e09285d63a..2c0491fa9b 100644
--- a/gnu/packages/haskell-apps.scm
+++ b/gnu/packages/haskell-apps.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2015 Paul van der Walt <[email-masked]>
 ;;; Copyright © 2019 Kyle Meyer <[email-masked]>
 ;;; Copyright © 2015 John Soo <[email-masked]>
+;;; Copyright © 2019 Alex Griffin <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -497,6 +498,51 @@ with CSS and mouseover annotations, XHTML 1.0 with inline CSS styling, LaTeX,
 and mIRC chat codes.")
     (license license:bsd-3)))
 
+(define-public kmonad
+  (package
+    (name "kmonad")
+    (version "0.2.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/david-janssen/kmonad.git")
+             (commit "06d7b8c709efa695be35df9bde91275cbb2ba099")))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1rjr4h5yq63x3kad6yn4p8v26389sd9dgr5n2w73s1chafapzwwd"))))
+    (build-system haskell-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (delete 'haddock)             ; Haddock fails to generate docs
+         (add-after 'install 'install-documentation
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (doc (string-append out "/share/doc/kmonad-" ,version)))
+               (install-file "README.md" doc)
+               (copy-recursively "doc" doc)
+               (copy-recursively "example" (string-append doc "/example"))
+               #t))))))
+    (inputs
+     `(("ghc-cereal" ,ghc-cereal)
+       ("ghc-exceptions" ,ghc-exceptions)
+       ("ghc-hashable" ,ghc-hashable)
+       ("ghc-lens" ,ghc-lens)
+       ("ghc-megaparsec" ,ghc-megaparsec-7)
+       ("ghc-optparse-applicative" ,ghc-optparse-applicative)
+       ("ghc-unagi-chan" ,ghc-unagi-chan)
+       ("ghc-unliftio" ,ghc-unliftio)
+       ("ghc-unordered-containers" ,ghc-unordered-containers)))
+    (home-page "https://github.com/david-janssen/kmonad")
+    (synopsis "Advanced keyboard manager")
+    (description "KMonad is a keyboard remapping utility that supports
+advanced functionality, such as custom keymap layers and modifiers, macros,
+and conditional mappings that send a different keycode when tapped or held.
+By operating at a lower level than most similar tools, it supports X11,
+Wayland, and Linux console environments alike.")
+    (license license:expat)))
+
 (define-public raincat
   (package
     (name "raincat")
-- 
2.23.0