guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

13/24: services: Support etc-service for the Hurd.


From: guix-commits
Subject: 13/24: services: Support etc-service for the Hurd.
Date: Mon, 8 Jun 2020 08:37:28 -0400 (EDT)

janneke pushed a commit to branch wip-hurd-vm
in repository guix.

commit f5ca79d2a26ece8ce58693916d3bec21749f14cb
Author: Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
AuthorDate: Sat Apr 25 11:55:56 2020 +0200

    services: Support etc-service for the Hurd.
    
    * gnu/system.scm (operating-system-etc-service): Cater for missing nsswitch
    and missing sudoers-file.  For the Hurd, add "login" and "motd".
    (hurd-default-essential-services): Add operating-system-etc-service.
---
 gnu/system.scm | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 4c23178..cca1c09 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -603,6 +603,7 @@ bookkeeping."
   (list (service system-service-type '())
         %boot-service
         %activation-service
+        (operating-system-etc-service os)
         (service profile-service-type '())))
 
 (define* (operating-system-services os)
@@ -708,7 +709,7 @@ This is the GNU system.  Welcome.\n")
 (define* (operating-system-etc-service os)
   "Return a <service> that builds containing the static part of the /etc
 directory."
-  (let ((login.defs
+  (let* ((login.defs
           (plain-file "login.defs"
                       (string-append
                         "# Default paths for non-login shells started by 
su(1).\n"
@@ -719,10 +720,13 @@ directory."
                         "/run/current-system/profile/bin:"
                         "/run/current-system/profile/sbin\n")))
 
-        (issue      (plain-file "issue" (operating-system-issue os)))
-        (nsswitch   (plain-file "nsswitch.conf"
-                                (name-service-switch->string
-                                 (operating-system-name-service-switch os))))
+         (hurd       (operating-system-hurd os))
+         (issue      (plain-file "issue" (operating-system-issue os)))
+         (nsswitch   (operating-system-name-service-switch os))
+         (nsswitch   (and nsswitch
+                          (plain-file "nsswitch.conf"
+                                      (name-service-switch->string nsswitch))))
+         (sudoers    (operating-system-sudoers-file os))
 
         ;; Startup file for POSIX-compliant login shells, which set system-wide
         ;; environment variables.
@@ -812,7 +816,7 @@ fi\n")))
        ("rpc" ,(file-append net-base "/etc/rpc"))
        ("login.defs" ,#~#$login.defs)
        ("issue" ,#~#$issue)
-       ("nsswitch.conf" ,#~#$nsswitch)
+       ,@(if nsswitch `(("nsswitch.conf" ,#~#$nsswitch)) '())
        ("profile" ,#~#$profile)
        ("bashrc" ,#~#$bashrc)
        ("hosts" ,#~#$(or (operating-system-hosts-file os)
@@ -828,7 +832,11 @@ fi\n")))
        ("timezone" ,(plain-file "timezone" (operating-system-timezone os)))
        ("localtime" ,(file-append tzdata "/share/zoneinfo/"
                                   (operating-system-timezone os)))
-       ("sudoers" ,(operating-system-sudoers-file os))))))
+       ,@(if sudoers `(("sudoers" ,sudoers)) '())
+       ,@(if hurd
+             `(("login" ,(file-append hurd "/etc/login"))
+               ("motd"  ,(file-append hurd "/etc/motd")))
+             '())))))
 
 (define %root-account
   ;; Default root account.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]