mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02:00
home: services: sway: Refactor flatmap to append-map.
* gnu/home/services/sway.scm (flatmap): Refactor flatmap to append-map. Change-Id: I1a8e46ac7f2de163bc33f4bf61f267d35893cfc2 Signed-off-by: jgart <jgart@dismail.de>
This commit is contained in:
@@ -102,18 +102,6 @@
|
||||
;; Convenient value to inherit for extensions.
|
||||
%empty-sway-configuration))
|
||||
|
||||
;; Helper function.
|
||||
(define (flatmap f l)
|
||||
(let loop ((lst (reverse l))
|
||||
(acc '()))
|
||||
(match lst
|
||||
(() acc)
|
||||
((head . tail)
|
||||
(let* ((h (f head))
|
||||
(acc (append h acc)))
|
||||
(loop tail acc))))))
|
||||
|
||||
|
||||
;;;
|
||||
;;; Definition of configurations.
|
||||
;;;
|
||||
@@ -894,13 +882,13 @@
|
||||
|
||||
;; Outputs.
|
||||
#$@(with-heading "Outputs."
|
||||
(flatmap serialize-output
|
||||
(sway-configuration-outputs conf)))
|
||||
(append-map serialize-output
|
||||
(sway-configuration-outputs conf)))
|
||||
|
||||
;; Inputs.
|
||||
#$@(with-heading "Inputs."
|
||||
(flatmap serialize-input
|
||||
(sway-configuration-inputs conf)))
|
||||
(append-map serialize-input
|
||||
(sway-configuration-inputs conf)))
|
||||
|
||||
;; Bar configuration:
|
||||
;; If the bar is unset, do not include anything.
|
||||
@@ -920,8 +908,8 @@
|
||||
|
||||
;; Modes.
|
||||
#$@(with-heading "Modes."
|
||||
(flatmap serialize-mode
|
||||
(sway-configuration-modes conf)))
|
||||
(append-map serialize-mode
|
||||
(sway-configuration-modes conf)))
|
||||
|
||||
;; Startup-Programs.
|
||||
#$@(with-heading
|
||||
|
||||
Reference in New Issue
Block a user