radix/modules/radix/files/fish.scm

62 lines
1.6 KiB
Scheme

(define-module (radix files fish)
#:use-module (gnu)
#:use-module (guix)
#:use-module (srfi srfi-26)
#:use-module (ice-9 ftw)
#:use-module (ice-9 rdelim)
#:use-module (radix combinators)
#:use-module (gnu packages shells)
#:export (functions
greeting
key-bindings
prompt
variables))
(define functions
(local-file "../../../files/fish/functions/functions.fish"))
(define greeting
(local-file "../../../files/fish/functions/greeting.fish"))
(define prompt
(local-file "../../../files/fish/functions/prompt.fish"))
(define variables
(local-file "../../../files/fish/variables.fish"))
(define key-bindings
(local-file "../../../files/fish/key-bindings.fish"))
#|
(define fenv-dir
(run-with-store (open-connection)
(package-file fish-foreign-env)))
(define fenv-files
(map (cut string-append fenv-dir "/share/fish/functions/" <>)
(filter (negate (cut string-prefix? "." <>))
(scandir (string-append fenv-dir
"/share/fish/functions")))))
(define (remove-unimportant-lines str)
(string-join
(filter (negate (inclusive-disjoin
string-null?
(cut string-prefix? "#" <>)))
(string-split str #\newline))
"\n"))
(define fenv
(plain-file "fenv"
(string-join
(map (lambda (file)
(let* ((port (open-input-file file))
(content (read-string port)))
(close-input-port port)
(remove-unimportant-lines content)))
fenv-files)
"\n")))
|#