home-services: shells: Remove use of fish-plugin-union
parent
de9ed44b81
commit
75a49cf0ad
|
@ -197,23 +197,26 @@ end\n\n")
|
||||||
home-fish-extension-plugins extension-configs)))))
|
home-fish-extension-plugins extension-configs)))))
|
||||||
|
|
||||||
(define (fish-plugin-files-service config)
|
(define (fish-plugin-files-service config)
|
||||||
(let* ((plugins (home-fish-configuration-plugins config))
|
(define (plugin-files plugin)
|
||||||
(plugin-union (fish-plugin-union plugins))
|
(define (directory-files dir)
|
||||||
(drv (run-with-store (open-connection)
|
(map (lambda (file)
|
||||||
(with-store %store
|
(let ((almost-basename (almost-basename file)))
|
||||||
(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)
|
(list (string-append "fish/" almost-basename)
|
||||||
(file-append plugin-union
|
(file-append plugin
|
||||||
(string-append "/share/"
|
(string-append "/share/"
|
||||||
almost-basename)))))
|
almost-basename)))))
|
||||||
(list-contents subdir)))
|
(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" <>))
|
(filter (negate (cut string-suffix? "doc" <>))
|
||||||
subdirs))))
|
(list-contents path)))))
|
||||||
|
|
||||||
|
(append-map plugin-files
|
||||||
|
(home-fish-configuration-plugins config)))
|
||||||
|
|
||||||
;; TODO: Support for generating completion files
|
;; TODO: Support for generating completion files
|
||||||
(define home-fish-service-type
|
(define home-fish-service-type
|
||||||
|
|
|
@ -96,31 +96,3 @@ shell.")
|
||||||
(description "This plugin aims to provide higher order functions for the
|
(description "This plugin aims to provide higher order functions for the
|
||||||
Fish shell.")
|
Fish shell.")
|
||||||
(license license:expat)))
|
(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)))
|
|
||||||
|
|
Loading…
Reference in New Issue