aboutsummaryrefslogtreecommitdiffstats
path: root/oni
diff options
context:
space:
mode:
authorGravatar Tom Willemse2023-08-23 10:57:10 -0700
committerGravatar Tom Willemse2023-08-23 10:57:10 -0700
commitc9d8a52b39ec49d29cf5aeb7e91ce926f9f1c3ac (patch)
treeaabf96a1f6ef09bc94a9d7d982d57ef4f9da06a5 /oni
parent75190437c43fa9e1146ed53c7f4c9bddd548f8b2 (diff)
downloadnew-dotfiles-c9d8a52b39ec49d29cf5aeb7e91ce926f9f1c3ac.tar.gz
new-dotfiles-c9d8a52b39ec49d29cf5aeb7e91ce926f9f1c3ac.zip
Add ZSH contextual abbrevs package
Diffstat (limited to 'oni')
-rw-r--r--oni/home/services/zsh.scm35
-rw-r--r--oni/packages/zsh.scm31
2 files changed, 65 insertions, 1 deletions
diff --git a/oni/home/services/zsh.scm b/oni/home/services/zsh.scm
index 80abdb4..d89a237 100644
--- a/oni/home/services/zsh.scm
+++ b/oni/home/services/zsh.scm
@@ -6,11 +6,14 @@
#:use-module (gnu home services utils)
#:use-module (guix packages)
#:use-module (guix gexp)
+ #:use-module (oni packages zsh)
#:export (home-zsh-autosuggestions-service-type
home-zsh-autosuggestions-configuration
home-zsh-syntax-highlighting-service-type
- home-zsh-syntax-highlighting-configuration))
+ home-zsh-syntax-highlighting-configuration
+ home-zsh-contextual-abbrevs-service-type
+ home-zsh-contextual-abbrevs-configuration))
(define-configuration/no-serialization home-zsh-autosuggestions-configuration
(package
@@ -72,3 +75,33 @@
(compose identity)
(default-value (home-zsh-syntax-highlighting-configuration))
(description "Install and configure zsh-syntax-highlighting.")))
+
+(define-configuration/no-serialization home-zsh-contextual-abbrevs-configuration
+ (package
+ (package zsh-contextual-abbrevs)
+ "Package to use for setting zsh-contexual-abbrevs."))
+
+(define (add-zsh-contextual-abbrevs config)
+ (home-zsh-extension
+ (zshrc
+ (list
+ (mixed-text-file
+ "zshrc"
+ "source " (home-zsh-contextual-abbrevs-configuration-package config) "/share/zsh/plugins/zsh-contextual-abbrevs/contextual-abbrevs.zsh")))))
+
+(define (add-zsh-contextual-abbrevs-packages config)
+ (list (home-zsh-contextual-abbrevs-configuration-package config)))
+
+(define home-zsh-contextual-abbrevs-service-type
+ (service-type
+ (name 'home-zsh-contextual-abbrevs)
+ (extensions
+ (list (service-extension
+ home-zsh-service-type
+ add-zsh-contextual-abbrevs)
+ (service-extension
+ home-profile-service-type
+ add-zsh-contextual-abbrevs-packages)))
+ (compose identity)
+ (default-value (home-zsh-contextual-abbrevs-configuration))
+ (description "Install and configure zsh-contextual-abbrevs.")))
diff --git a/oni/packages/zsh.scm b/oni/packages/zsh.scm
new file mode 100644
index 0000000..e5cad34
--- /dev/null
+++ b/oni/packages/zsh.scm
@@ -0,0 +1,31 @@
+(define-module (oni packages zsh)
+ #:use-module ((guix licenses) #:prefix license:)
+ #:use-module ((guix packages) #:select (package origin base32))
+ #:use-module ((guix git-download) #:select (git-version
+ git-reference
+ git-fetch
+ git-file-name))
+ #:use-module ((guix build-system copy) #:select (copy-build-system)))
+
+(define-public zsh-contextual-abbrevs
+ (let ((commit "232ac42d70dba257fa904fc9a96f2a3bfed16585")
+ (revision "0"))
+ (package
+ (name "zsh-contextual-abbrevs")
+ (version (git-version "0.0.0" revision commit))
+ (source (origin
+ (uri (git-reference
+ (url "https://github.com/langston-barrett/zsh-contextual-abbrevs.git")
+ (commit commit)))
+ (method git-fetch)
+ (sha256
+ (base32 "02r6k0bhdbj585mchz8m9z5yjzk7xd48mz4mamirb9nap4n870zh"))
+ (file-name (git-file-name name version))))
+ (build-system copy-build-system)
+ (arguments
+ '(#:install-plan '(("src"
+ "/share/zsh/plugins/zsh-contextual-abbrevs"))))
+ (synopsis "Auto")
+ (description "Something")
+ (license license:expat)
+ (home-page "https://example.org"))))