From cb00e600ffe7ec493464788dd16308b7b8e87d20 Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Sat, 25 Feb 2023 18:57:47 +0000 Subject: services: base: Deprecate 'host-name-service' procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/guix.texi (operating-system Reference): Reorder cross-reference. Add an anchor to be used ... (Base services): ... here by host-name-service-type. Document host-name-service-type. * gnu/services/base.scm: Export host-name-service-type. (host-name-service): Deprecate procedure. * gnu/system.scm (operating-system-default-essential-services): Use host-name-service-type. Signed-off-by: Ludovic Courtès --- gnu/system.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index 53f3c62bb0..bb26d7c9a5 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -782,7 +782,7 @@ (define known-fs (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)) -- cgit v1.2.3 From 02be907a12dc291b02f6e895ca15f2fb20037185 Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Fri, 10 Mar 2023 20:21:21 +0000 Subject: system: Simplify nsswitch binding. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/system.scm (operating-system-etc-service): Simplify nsswitch binding. Signed-off-by: Ludovic Courtès --- gnu/system.scm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index bb26d7c9a5..2947d1321f 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1001,10 +1001,9 @@ (define* (operating-system-etc-service 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)))) + (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 -- cgit v1.2.3 From 0f4a96ccd11115f7a1d8721aca7dc42e7a0a46c2 Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Fri, 10 Mar 2023 20:21:22 +0000 Subject: system: Remove redundant gexp-ungexp usage. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/system.scm (os-release): Convert to variable. (operating-system-etc-service): Remove redundant gexp-ungexps. Signed-off-by: Ludovic Courtès --- gnu/system.scm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'gnu/system.scm') diff --git a/gnu/system.scm b/gnu/system.scm index 2947d1321f..887e537b48 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -967,9 +967,8 @@ (define (validated-sudoers-file file) "--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\" @@ -1092,15 +1091,15 @@ (define* (operating-system-etc-service os) source /run/current-system/profile/etc/profile.d/bash_completion.sh fi\n"))) (etc-service - `(("os-release" ,#~#$(os-release)) + `(("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 -- cgit v1.2.3 From 93918c67c5761d8f688cda5f5b49d5c49c7626d0 Mon Sep 17 00:00:00 2001 From: Bruno Victal Date: Mon, 13 Mar 2023 17:36:14 +0000 Subject: services: etc-service: Deprecate etc-service procedure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/services.scm (etc-service): Deprecate procedure. * gnu/system.scm (operating-system-etc-service): Replace etc-service with etc-service-type. Signed-off-by: Ludovic Courtès --- gnu/services.scm | 6 ++++-- gnu/system.scm | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'gnu/system.scm') diff --git a/gnu/services.scm b/gnu/services.scm index 2abef557d4..d6c7ad0553 100644 --- a/gnu/services.scm +++ b/gnu/services.scm @@ -39,6 +39,7 @@ (define-module (gnu services) #:use-module (guix modules) #:use-module (guix packages) #:use-module (guix utils) + #:use-module (guix deprecation) #:use-module (gnu packages base) #:use-module (gnu packages bash) #:use-module (gnu packages hurd) @@ -122,7 +123,7 @@ (define-module (gnu services) %boot-service %activation-service - etc-service) + etc-service) ; deprecated #:re-export (;; Note: Re-export 'delete' to allow for proper syntax matching ;; in 'modify-services' forms. See ;; . @@ -804,7 +805,8 @@ (define etc-service-type (extend append) (description "Populate the @file{/etc} directory."))) -(define (etc-service files) +(define-deprecated (etc-service files) + etc-service-type "Return a new service of ETC-SERVICE-TYPE that populates /etc with FILES. FILES must be a list of name/file-like object pairs." (service etc-service-type files)) diff --git a/gnu/system.scm b/gnu/system.scm index 887e537b48..48cc68f449 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -1090,7 +1090,7 @@ (define* (operating-system-etc-service os) # 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 + (service etc-service-type `(("os-release" ,os-release) ("services" ,(file-append net-base "/etc/services")) ("protocols" ,(file-append net-base "/etc/protocols")) -- cgit v1.2.3