home-services: shells: Remove use of fish-plugin-union

pull/3/head
Luis Guilherme Coelho 2024-07-05 15:23:45 -03:00
parent de9ed44b81
commit 75a49cf0ad
No known key found for this signature in database
GPG Key ID: 1F2E76ACE3F531C8
2 changed files with 20 additions and 45 deletions

View File

@ -197,23 +197,26 @@ end\n\n")
home-fish-extension-plugins extension-configs)))))
(define (fish-plugin-files-service config)
(let* ((plugins (home-fish-configuration-plugins config))
(plugin-union (fish-plugin-union plugins))
(drv (run-with-store (open-connection)
(with-store %store
(package->derivation plugin-union))))
(path (string-append (derivation->output-path drv) "/share"))
(subdirs (list-contents path)))
(append-map (lambda (subdir)
(map (lambda (content)
(let ((almost-basename (almost-basename content)))
(list (string-append "fish/" almost-basename)
(file-append plugin-union
(string-append "/share/"
almost-basename)))))
(list-contents subdir)))
(filter (negate (cut string-suffix? "doc" <>))
subdirs))))
(define (plugin-files plugin)
(define (directory-files dir)
(map (lambda (file)
(let ((almost-basename (almost-basename file)))
(list (string-append "fish/" almost-basename)
(file-append plugin
(string-append "/share/"
almost-basename)))))
(list-contents dir)))
(let* ((drv (run-with-store (open-connection)
(with-store %store
(package->derivation plugin))))
(path (string-append (derivation->output-path drv) "/share")))
(append-map directory-files
(filter (negate (cut string-suffix? "doc" <>))
(list-contents path)))))
(append-map plugin-files
(home-fish-configuration-plugins config)))
;; TODO: Support for generating completion files
(define home-fish-service-type

View File

@ -96,31 +96,3 @@ shell.")
(description "This plugin aims to provide higher order functions for the
Fish shell.")
(license license:expat)))
(define* (fish-plugin-union packages)
"Return 'fish-plugin-union' package which is a union of PACKAGES."
(package
(name "fish-plugin-union")
(version (package-version fish))
(source #f)
(build-system trivial-build-system)
(arguments
'(#:modules ((guix build union))
#:builder (begin
(use-modules (ice-9 match)
(guix build union))
(match %build-inputs
(((names . directories) ...)
(union-build (assoc-ref %outputs "out")
directories)
#t)))))
(inputs (map (lambda (package)
(list (package-name package) package))
packages))
(synopsis "Union of fish plugins.")
(description
"A union of fish plugins. A union is required because
fish assumes that all of the functions, hooks and conf.d files are in the same
directory.")
(home-page (package-home-page fish))
(license license:expat)))