@@ 24,7 24,6 @@
#:use-module (gnu services configuration)
#:use-module (guix derivations)
#:use-module (guix gexp)
- #:use-module (guix modules)
#:use-module (guix monads)
#:use-module (guix profiles)
#:use-module (guix records)
@@ 42,8 41,7 @@
(define file-like-or-#f?
(match-lambda
- ((or #f
- (? file-like?)) #t)
+ ((or #f (? file-like?)) #t)
(_ #f)))
(define-configuration/no-serialization home-emacs-configuration
@@ 96,15 94,6 @@ EMACS-MINIMAL.")
(content (packages->manifest (cons (emacs-for-compile config)
packages))))))
-(define not-config?
- ;; Select (guix …) and (gnu …) modules, except (guix config).
- (match-lambda
- (('guix 'config) #f)
- ((or ('gnu rest ...)
- ('guix rest ...))
- #t)
- (rest #f)))
-
(define (build-emacs-profile config)
(with-store store
(run-with-store store
@@ 118,27 107,24 @@ EMACS-MINIMAL.")
"out"))))))))
(define (emacs-environment config)
- (with-imported-modules (source-module-closure '((guix search-paths)))
- #~(begin
- (use-modules (guix search-paths))
- (map (lambda (env-var)
- (let ((variable (list-ref env-var 0))
- (separator (list-ref env-var 1))
- (value (list-ref env-var 2)))
- (string-append variable "="
- (or (and=> (getenv variable)
- (lambda (original)
- (string-append original
- separator)))
- "")
- value)))
- '(#$@(map (match-lambda
- ((spec . value)
- (match-record spec <search-path-specification>
- (variable separator)
- (list variable separator value))))
- (profile-search-paths
- (build-emacs-profile config))))))))
+ #~(map (lambda (env-var)
+ (let ((variable (list-ref env-var 0))
+ (separator (list-ref env-var 1))
+ (value (list-ref env-var 2)))
+ (string-append variable "="
+ (or (and=> (getenv variable)
+ (lambda (original)
+ (string-append original
+ separator)))
+ "")
+ value)))
+ '(#$@(map (match-lambda
+ ((spec . value)
+ (match-record spec <search-path-specification>
+ (variable separator)
+ (list variable separator value))))
+ (profile-search-paths
+ (build-emacs-profile config))))))
(define (home-emacs-profile-packages config)
(match-record config <home-emacs-configuration> (emacs)
@@ 154,17 140,12 @@ EMACS-MINIMAL.")
(string-append "Start the Emacs server called "
server "."))
(start
- #~(make-systemd-constructor
+ #~(make-forkexec-constructor
(list #$(file-append emacs "/bin/emacs")
(string-append "--fg-daemon=" #$server)
#$@(if debug?
(list "--debug-init")
'()))
- (list (endpoint
- (make-socket-address
- AF_UNIX
- (format #f "/run/user/~a/emacs/~a"
- (getuid) #$server))))
#:log-file
(format #f "~a/log/emacs/~a.log"
(or (getenv "XDG_STATE_HOME")