[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
03/03: system: Add /etc/environment.
From: |
??? |
Subject: |
03/03: system: Add /etc/environment. |
Date: |
Sat, 05 Dec 2015 02:52:17 +0000 |
iyzsong pushed a commit to branch master
in repository guix.
commit 6bad7524a6dba18f700893953584ad8865b18729
Author: 宋文武 <address@hidden>
Date: Wed Dec 2 21:14:02 2015 +0800
system: Add /etc/environment.
* gnu/system.scm: (operating-system-environment-variables): New procedure.
Adapted and moved environment variables from /etc/profile.
(operating-system-etc-service): Adjust accordingly.
(essential-services): Add an instance of SESSION-ENVIRONMENT-SERVICE-TYPE.
---
gnu/system.scm | 39 ++++++++++++++++++++-------------------
1 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/gnu/system.scm b/gnu/system.scm
index 2755d85..ff981d9 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -299,6 +299,8 @@ a container or that of a \"bare metal\" system."
(operating-system-groups os))
(operating-system-skeletons os))
(operating-system-etc-service os)
+ (session-environment-service
+ (operating-system-environment-variables os))
host-name procs root-fs unmount
(service setuid-program-service-type
(operating-system-setuid-programs os))
@@ -417,18 +419,6 @@ directory."
;; Startup file for POSIX-compliant login shells, which set system-wide
;; environment variables.
(profile (mixed-text-file "profile" "\
-export LANG=\"" (operating-system-locale os) "\"
-export TZ=\"" (operating-system-timezone os) "\"
-export TZDIR=\"" tzdata "/share/zoneinfo\"
-
-# Tell 'modprobe' & co. where to look for modules.
-export LINUX_MODULE_DIRECTORY=/run/booted-system/kernel/lib/modules
-
-# These variables are honored by OpenSSL (libssl) and Git.
-export SSL_CERT_DIR=/etc/ssl/certs
-export SSL_CERT_FILE=\"$SSL_CERT_DIR/ca-certificates.crt\"
-export GIT_SSL_CAINFO=\"$SSL_CERT_FILE\"
-
# Crucial variables that could be missing in the profiles' 'etc/profile'
# because they would require combining both profiles.
# FIXME: See <http://bugs.gnu.org/20255>.
@@ -458,13 +448,6 @@ else
export PATH=\"$HOME/.guix-profile/bin:$PATH\"
fi
-# Append the directory of 'site-start.el' to the search path.
-export EMACSLOADPATH=:/etc/emacs
-
-# By default, applications that use D-Bus, such as Emacs, abort at startup
-# when /etc/machine-id is missing. Make sure these warnings are non-fatal.
-export DBUS_FATAL_WARNINGS=0
-
# Allow Aspell to find dictionaries installed in the user profile.
export ASPELL_CONF=\"dict-dir $HOME/.guix-profile/lib/aspell\"
@@ -561,6 +544,24 @@ use 'plain-file' instead~%")
(fold-services (operating-system-services os)
#:target-type etc-service-type)))
+(define (operating-system-environment-variables os)
+ "Return the environment variables of OS for
address@hidden, to be used in @file{/etc/environment}."
+ `(("LANG" . ,(operating-system-locale os))
+ ("TZ" . ,(operating-system-timezone os))
+ ("TZDIR" . ,#~(string-append #$tzdata "/share/zoneinfo"))
+ ;; Tell 'modprobe' & co. where to look for modules.
+ ("LINUX_MODULE_DIRECTORY" . "/run/booted-system/kernel/lib/modules")
+ ;; These variables are honored by OpenSSL (libssl) and Git.
+ ("SSL_CERT_DIR" . "/etc/ssl/certs")
+ ("SSL_CERT_FILE" . "/etc/ssl/certs/ca-certificates.crt")
+ ("GIT_SSL_CAINFO" . "/etc/ssl/certs/ca-certificates.crt")
+ ;; Append the directory of 'site-start.el' to the search path.
+ ("EMACSLOADPATH" . ":/etc/emacs")
+ ;; By default, applications that use D-Bus, such as Emacs, abort at startup
+ ;; when /etc/machine-id is missing. Make sure these warnings are
non-fatal.
+ ("DBUS_FATAL_WARNINGS" . "0")))
+
(define %setuid-programs
;; Default set of setuid-root programs.
(let ((shadow (@ (gnu packages admin) shadow)))