From e0f1dd5d07f3b08c08f023171650969a9a36199b Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Sun, 3 Apr 2022 01:32:27 -0700 Subject: Add a kitty home service with configuration --- oni/home/data/config.scm | 56 +++++++++++++++++++++++++++++++++++++++++++-- oni/home/services/kitty.scm | 48 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 oni/home/services/kitty.scm (limited to 'oni') diff --git a/oni/home/data/config.scm b/oni/home/data/config.scm index daa37f2..ca0b40f 100644 --- a/oni/home/data/config.scm +++ b/oni/home/data/config.scm @@ -8,7 +8,8 @@ #:use-module (gnu packages admin) #:use-module (guix gexp) #:use-module (oni home services xdisorg) - #:use-module (oni home services xmodmap)) + #:use-module (oni home services xmodmap) + #:use-module (oni home services kitty)) (home-environment (packages (list (specification->package+output "glibc-locales"))) @@ -125,4 +126,55 @@ (pointer '(3 2 1)) (extra '("remove Mod5 = ISO_Level3_Shift" "keycode 108 = Alt_L" - "add Mod1 = Alt_L"))))))) + "add Mod1 = Alt_L")))) + + (service home-kitty-service-type + (home-kitty-configuration + (configuration + '((font-family . "Fantasque Sans Mono") + (bold-font . "Fantasque Sans Mono Bold") + (italic-font . "Fantasque Sans Mono Italic") + (bold-italic-font . "Fantasque Sans Mono Bold Italic") + (font-size . 14) + (symbol-map . "U+f002 Font Awesome 5 Free Solid") + (cursor-shape . beam) + (cursor-blink-interval . 0) + (url-style . single) + (open-url-with . firefox) + (copy-on-select . #f) + (enable-audio-bell . #f) + (visual-bell-duration . 0) + (window-padding-width . 11.25) + (active-tab-font-style . normal) + (editor . emacsclient) + (allow-remote-control . #t) + (enabled-layouts vertical stack tall fat grid horizontal) + (cursor . "#969696") + (url-color . "#a88654") + (active-border-color . "#1f2c3f") + (inactive-border-color . "#3d3d3d") + (bell-border-color . "#3f1a1a") + (active-tab-foreground . "#65a854") + (active-tab-background . "#1f2c3f") + (inactive-tab-foreground . "#65a854") + (inactive-tab-background . "#3d3d3d") + (foreground . "#bfbfbf") + (background . "#222424") + (selection-foreground . "#bfbfbf") + (selection-background . "#1f2c3f") + (color0 . "#222222") + (color8 . "#3d3d3d") + (color1 . "#3f1a1a") + (color9 . "#da9d9d") + (color2 . "#65a854") + (color10 . "#a9d39e") + (color3 . "#8d995c") + (color11 . "#c2ca9e") + (color4 . "#5476a8") + (color12 . "#a2b8b8") + (color5 . "#9754a8") + (color13 . "#d0a8da") + (color6 . "#54a8a8") + (color14 . "#abdddd") + (color7 . "#969696") + (color15 . "#ededed")))))))) diff --git a/oni/home/services/kitty.scm b/oni/home/services/kitty.scm new file mode 100644 index 0000000..23061dd --- /dev/null +++ b/oni/home/services/kitty.scm @@ -0,0 +1,48 @@ +(define-module (oni home services kitty) + #:use-module (gnu services configuration) + #:use-module (gnu packages terminals) + #:use-module (gnu home services) + #:use-module (gnu home services utils) + #:use-module (guix packages) + #:use-module (guix gexp) + #:use-module (string transform) + + #:export (home-kitty-service-type + home-kitty-configuration)) + +(define-configuration/no-serialization home-kitty-configuration + (package + (package kitty) + "Package to use for setting kitty") + (configuration + (alist '()) + "List of configuration settings.")) + +(define (serialize-kitty-setting setting) + (format #f "~a ~a" + (transform-string (symbol->string (car setting)) #\- #\_) + (let ((value (cdr setting))) + (cond + ((boolean? value) (if value "yes" "no")) + ((list? value) (string-join (map symbol->string value) ", ")) + (else value))))) + +(define (serialize-kitty-config config) + (string-join (map serialize-kitty-setting (home-kitty-configuration-configuration config)) "\n" 'suffix)) + +(define (kitty-home-files config) + `(("config/kitty/kitty.conf" + ,(mixed-text-file + "kitty.conf" + (serialize-kitty-config config))))) + +(define home-kitty-service-type + (service-type + (name 'home-kitty) + (extensions + (list (service-extension + home-files-service-type + kitty-home-files))) + (compose identity) + (default-value (home-kitty-configuration)) + (description "Install and configure kitty."))) -- cgit v1.2.3-54-g00ecf