summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/system.scm35
1 files changed, 35 insertions, 0 deletions
diff --git a/gnu/system.scm b/gnu/system.scm
index 78c63bb477f..bb11189e8f2 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -372,6 +372,36 @@ This is the GNU system. Welcome.\n")
372 "Return the default /etc/hosts file." 372 "Return the default /etc/hosts file."
373 (text-file "hosts" (local-host-aliases host-name))) 373 (text-file "hosts" (local-host-aliases host-name)))
374 374
375(define (emacs-site-file)
376 "Return the Emacs 'site-start.el' file. That file contains the necessary
377settings for 'guix.el' to work out-of-the-box."
378 (gexp->file "site-start.el"
379 #~(progn
380 ;; Add the "normal" elisp directory to the search path;
381 ;; guix.el may be there.
382 (add-to-list
383 'load-path
384 "/run/current-system/profile/share/emacs/site-lisp")
385
386 ;; Attempt to load guix.el.
387 (require 'guix-init nil t)
388
389 (when (require 'geiser-guile nil t)
390 ;; Make sure Geiser's Scheme modules are in Guile's search
391 ;; path.
392 (add-to-list
393 'geiser-guile-load-path
394 "/run/current-system/profile/share/geiser/guile")))))
395
396(define (emacs-site-directory)
397 "Return the Emacs site directory, aka. /etc/emacs."
398 (mlet %store-monad ((file (emacs-site-file)))
399 (gexp->derivation "emacs"
400 #~(begin
401 (mkdir #$output)
402 (chdir #$output)
403 (symlink #$file "site-start.el")))))
404
375(define* (etc-directory #:key 405(define* (etc-directory #:key
376 (locale "C") (timezone "Europe/Paris") 406 (locale "C") (timezone "Europe/Paris")
377 (issue "Hello!\n") 407 (issue "Hello!\n")
@@ -390,6 +420,7 @@ This is the GNU system. Welcome.\n")
390/bin/sh 420/bin/sh
391/run/current-system/profile/bin/sh 421/run/current-system/profile/bin/sh
392/run/current-system/profile/bin/bash\n")) 422/run/current-system/profile/bin/bash\n"))
423 (emacs (emacs-site-directory))
393 (issue (text-file "issue" issue)) 424 (issue (text-file "issue" issue))
394 425
395 ;; For now, generate a basic config so that /etc/hosts is honored. 426 ;; For now, generate a basic config so that /etc/hosts is honored.
@@ -410,12 +441,16 @@ export PATH=$HOME/.guix-profile/bin:/run/current-system/profile/bin
410export PATH=/run/setuid-programs:/run/current-system/profile/sbin:$PATH 441export PATH=/run/setuid-programs:/run/current-system/profile/sbin:$PATH
411export MANPATH=$HOME/.guix-profile/share/man:/run/current-system/profile/share/man 442export MANPATH=$HOME/.guix-profile/share/man:/run/current-system/profile/share/man
412export INFOPATH=$HOME/.guix-profile/share/info:/run/current-system/profile/share/info 443export INFOPATH=$HOME/.guix-profile/share/info:/run/current-system/profile/share/info
444
445# Append the directory of 'site-start.el' to the search path.
446export EMACSLOADPATH=:/etc/emacs
413")) 447"))
414 (skel (skeleton-directory skeletons))) 448 (skel (skeleton-directory skeletons)))
415 (file-union "etc" 449 (file-union "etc"
416 `(("services" ,#~(string-append #$net-base "/etc/services")) 450 `(("services" ,#~(string-append #$net-base "/etc/services"))
417 ("protocols" ,#~(string-append #$net-base "/etc/protocols")) 451 ("protocols" ,#~(string-append #$net-base "/etc/protocols"))
418 ("rpc" ,#~(string-append #$net-base "/etc/rpc")) 452 ("rpc" ,#~(string-append #$net-base "/etc/rpc"))
453 ("emacs" ,#~#$emacs)
419 ("pam.d" ,#~#$pam.d) 454 ("pam.d" ,#~#$pam.d)
420 ("login.defs" ,#~#$login.defs) 455 ("login.defs" ,#~#$login.defs)
421 ("issue" ,#~#$issue) 456 ("issue" ,#~#$issue)