pop-os: Add atuin configuration
This commit is contained in:
parent
1c28487eca
commit
b66c126212
2 changed files with 55 additions and 6 deletions
|
@ -34,8 +34,6 @@
|
|||
home-stumpwm-stumptray-service-type
|
||||
home-stumpwm-stumptray-configuration))
|
||||
#:use-module (oni home services zsh)
|
||||
#:use-module ((oni packages atuin)
|
||||
#:select (rust-atuin-18))
|
||||
#:use-module ((oni packages emacs)
|
||||
#:select (emacs-php-ts-mode))
|
||||
#:use-module ((oni packages emacs-config)
|
||||
|
@ -105,9 +103,7 @@
|
|||
emacs-php-ts-mode
|
||||
emacs-oni-lua
|
||||
emacs-oni-sh
|
||||
emacs-deft
|
||||
|
||||
rust-atuin-18))
|
||||
emacs-deft))
|
||||
(services (list home-channels-service
|
||||
home-environment-service
|
||||
(service home-emacs-service-type
|
||||
|
@ -136,6 +132,9 @@
|
|||
(service home-zsh-syntax-highlighting-service-type)
|
||||
(service home-zsh-autosuggestions-service-type)
|
||||
(service home-zsh-contextual-abbrevs-service-type)
|
||||
(service home-zsh-atuin-service-type
|
||||
(home-zsh-atuin-configuration
|
||||
(inline-height 20)))
|
||||
|
||||
(service home-stumpwm-service-type
|
||||
(home-stumpwm-configuration
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
(define-module (oni home services zsh)
|
||||
#:use-module (ice-9 string-fun)
|
||||
#:use-module (gnu services configuration)
|
||||
#:use-module (gnu packages shellutils)
|
||||
#:use-module (gnu home services)
|
||||
|
@ -6,6 +7,8 @@
|
|||
#:use-module (gnu home services utils)
|
||||
#:use-module (guix packages)
|
||||
#:use-module (guix gexp)
|
||||
#:use-module ((oni packages atuin)
|
||||
#:select (rust-atuin-18))
|
||||
#:use-module (oni packages zsh)
|
||||
|
||||
#:export (home-zsh-autosuggestions-service-type
|
||||
|
@ -15,7 +18,9 @@
|
|||
home-zsh-contextual-abbrevs-service-type
|
||||
home-zsh-contextual-abbrevs-configuration
|
||||
home-zsh-autopair-service-type
|
||||
home-zsh-autopair-configuration))
|
||||
home-zsh-autopair-configuration
|
||||
home-zsh-atuin-service-type
|
||||
home-zsh-atuin-configuration))
|
||||
|
||||
(define-configuration/no-serialization home-zsh-autosuggestions-configuration
|
||||
(package
|
||||
|
@ -137,3 +142,48 @@
|
|||
(compose identity)
|
||||
(default-value (home-zsh-autopair-configuration))
|
||||
(description "Install and configure zsh-autopair.")))
|
||||
|
||||
(define (serialize-integer field value)
|
||||
(format #f "~a = ~a" (string-replace-substring (symbol->string field) "-" "_") value))
|
||||
|
||||
(define-configuration home-zsh-atuin-configuration
|
||||
(package
|
||||
(package rust-atuin-18)
|
||||
"Package to use for setting atuin.")
|
||||
(inline-height
|
||||
(integer 40)
|
||||
"Set the maximum number of lines Atuin’s interface should take up."))
|
||||
|
||||
(define (add-zsh-atuin config)
|
||||
(home-zsh-extension
|
||||
(zshrc
|
||||
(list
|
||||
(mixed-text-file
|
||||
"zshrc"
|
||||
"eval \"$(" (home-zsh-atuin-configuration-package config) "/bin/atuin init zsh)\"\n")))))
|
||||
|
||||
(define (add-zsh-atuin-configuration config)
|
||||
`(("atuin/config.toml"
|
||||
,(mixed-text-file
|
||||
"config.toml"
|
||||
(serialize-configuration config home-zsh-atuin-configuration-fields)))))
|
||||
|
||||
(define (add-zsh-atuin-packages config)
|
||||
(list (home-zsh-atuin-configuration-package config)))
|
||||
|
||||
(define home-zsh-atuin-service-type
|
||||
(service-type
|
||||
(name 'home-zsh-atuin)
|
||||
(extensions
|
||||
(list (service-extension
|
||||
home-zsh-service-type
|
||||
add-zsh-atuin)
|
||||
(service-extension
|
||||
home-profile-service-type
|
||||
add-zsh-atuin-packages)
|
||||
(service-extension
|
||||
home-xdg-configuration-files-service-type
|
||||
add-zsh-atuin-configuration)))
|
||||
(compose identity)
|
||||
(default-value (home-zsh-atuin-configuration))
|
||||
(description "Install and configure atuin.")))
|
||||
|
|
Loading…
Add table
Reference in a new issue