mirror of
https://codeberg.org/hako/Rosenthal.git
synced 2026-11-29 22:58:06 +00:00
services: home-emacs: Use load-profile from (guix profiles).
* modules/rosenthal/home/services/emacs.scm (home-emacs-package): Use ‘load-profile’ for home-emacs-program and simplify.
This commit is contained in:
1 file changed
+11
-31
@@ -10,7 +10,7 @@
|
|||||||
#:use-module (guix packages)
|
#:use-module (guix packages)
|
||||||
#:use-module (guix profiles)
|
#:use-module (guix profiles)
|
||||||
#:use-module (guix records)
|
#:use-module (guix records)
|
||||||
#:use-module (guix search-paths)
|
#:autoload (guix self) (make-config.scm)
|
||||||
;; Guix System - services
|
;; Guix System - services
|
||||||
#:use-module (gnu services)
|
#:use-module (gnu services)
|
||||||
#:use-module (gnu services configuration)
|
#:use-module (gnu services configuration)
|
||||||
@@ -45,41 +45,21 @@ of Emacs extensions.")
|
|||||||
(content (manifest
|
(content (manifest
|
||||||
(cons (package->manifest-entry emacs)
|
(cons (package->manifest-entry emacs)
|
||||||
(manifest-entries packages))))))
|
(manifest-entries packages))))))
|
||||||
(home-emacs-search-paths
|
|
||||||
(map search-path-specification->sexp
|
|
||||||
(manifest-search-paths
|
|
||||||
(profile-content home-emacs-profile))))
|
|
||||||
(home-emacs-program
|
(home-emacs-program
|
||||||
(program-file "home-emacs-program"
|
(program-file "home-emacs-program"
|
||||||
(with-imported-modules
|
(with-imported-modules
|
||||||
(source-module-closure
|
(cons `((guix config) => ,(make-config.scm))
|
||||||
'((guix search-paths)
|
(delete '(guix config)
|
||||||
(guix build utils)))
|
(source-module-closure '((guix profiles)))))
|
||||||
#~(begin
|
#~(begin
|
||||||
(use-modules (ice-9 match)
|
(use-modules (ice-9 match)
|
||||||
(guix search-paths)
|
(guix profiles))
|
||||||
(guix build utils))
|
(load-profile #$home-emacs-profile)
|
||||||
(let ((profile #$home-emacs-profile))
|
(match (command-line)
|
||||||
;; See also (@ (guix profiles) load-profile).
|
((cmd . args)
|
||||||
(for-each
|
(apply system*
|
||||||
(match-lambda
|
(string-append #$home-emacs-profile "/bin/" (basename cmd))
|
||||||
((($ <search-path-specification> variable _ separator) . value)
|
args))))))))
|
||||||
(let ((current (getenv variable)))
|
|
||||||
(setenv variable
|
|
||||||
(if current
|
|
||||||
(if separator
|
|
||||||
(string-append value separator current)
|
|
||||||
value)
|
|
||||||
value)))))
|
|
||||||
(evaluate-search-paths
|
|
||||||
(map sexp->search-path-specification
|
|
||||||
'#$home-emacs-search-paths)
|
|
||||||
(list profile)))
|
|
||||||
(match (command-line)
|
|
||||||
((cmd . args)
|
|
||||||
(apply system*
|
|
||||||
(string-append profile "/bin/" (basename cmd))
|
|
||||||
args)))))))))
|
|
||||||
(package
|
(package
|
||||||
(inherit emacs)
|
(inherit emacs)
|
||||||
(name "emacs-wrapper")
|
(name "emacs-wrapper")
|
||||||
|
|||||||
Reference in new issue
Block a user