summary refs log tree commit diff
path: root/gnu/system.scm
diff options
context:
space:
mode:
authorAndreas Enge <andreas@enge.fr>2023-03-20 18:21:47 +0100
committerAndreas Enge <andreas@enge.fr>2023-03-20 18:49:06 +0100
commitccb62d8feb50e2859d7c41429a9e3d9e0fe30bfe (patch)
tree4ab573cee33f277828ad553a22579175b1dda22d /gnu/system.scm
parent098bd280f82350073e8280e37d56a14162eed09c (diff)
parentf80215c7c4ae5ea0c316f4766e6c05ae4218ede3 (diff)
downloadguix-ccb62d8feb50e2859d7c41429a9e3d9e0fe30bfe.tar.gz
Merge remote-tracking branch 'origin/master' into core-updates
Diffstat (limited to 'gnu/system.scm')
-rw-r--r--gnu/system.scm28
1 files changed, 13 insertions, 15 deletions
diff --git a/gnu/system.scm b/gnu/system.scm
index bb1b7b5309..34195d53d1 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -782,7 +782,7 @@ bookkeeping."
                             (operating-system-file-systems os)))
            (session-environment-service
             (operating-system-environment-variables os))
-           (host-name-service host-name)
+           (service host-name-service-type host-name)
            procs root-fs
            (service setuid-program-service-type
                     (operating-system-setuid-programs os))
@@ -967,9 +967,8 @@ syntactically correct."
                                "--check" "--file" #$file)
                        (copy-file #$file #$output)))))
 
-(define (os-release)
-  (plain-file "os-release"
-              "\
+(define os-release
+  (plain-file "os-release" "\
 NAME=\"Guix System\"
 ID=guix
 PRETTY_NAME=\"Guix System\"
@@ -1001,10 +1000,9 @@ the /etc directory."
 
          (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))))
+         (nsswitch   (and=> (operating-system-name-service-switch os)
+                            (compose (cut plain-file "nsswitch.conf" <>)
+                                     name-service-switch->string)))
          (sudoers    (operating-system-sudoers-file os))
 
         ;; Startup file for POSIX-compliant login shells, which set system-wide
@@ -1092,16 +1090,16 @@ then
   # as those in ~/.guix-profile and /run/current-system/profile.
   source /run/current-system/profile/etc/profile.d/bash_completion.sh
 fi\n")))
-    (etc-service
-     `(("os-release" ,#~#$(os-release))
+    (service etc-service-type
+     `(("os-release" ,os-release)
        ("services" ,(file-append net-base "/etc/services"))
        ("protocols" ,(file-append net-base "/etc/protocols"))
        ("rpc" ,(file-append net-base "/etc/rpc"))
-       ("login.defs" ,#~#$login.defs)
-       ("issue" ,#~#$issue)
-       ,@(if nsswitch `(("nsswitch.conf" ,#~#$nsswitch)) '())
-       ("profile" ,#~#$profile)
-       ("bashrc" ,#~#$bashrc)
+       ("login.defs" ,login.defs)
+       ("issue" ,issue)
+       ,@(if nsswitch `(("nsswitch.conf" ,nsswitch)) '())
+       ("profile" ,profile)
+       ("bashrc" ,bashrc)
        ;; Write the operating-system-host-name to /etc/hostname to prevent
        ;; NetworkManager from changing the system's hostname when connecting
        ;; to certain networks.  Some discussion at