guix_mirror_bot pushed a commit to branch master
in repository guix.
commit de0e6484240295e2fc4e8ab0c8365f032786bb2d
Author: Yelninei <[email protected]>
AuthorDate: Mon Aug 10 19:08:58 2026 +0000
services: Add domain-name-service-type.
* gnu/services/base.scm (Add domain-name-service-type): New variable.
* doc/guix.texi (domain-name-service-type): Add documentation.
Change-Id: I63ab4d71de958a697bc53aa4b679b8ebb83553c4
Signed-off-by: Ludovic Courtès <[email protected]>
---
doc/guix.texi | 11 +++++++++++
gnu/services/base.scm | 14 ++++++++++++++
2 files changed, 25 insertions(+)
diff --git a/doc/guix.texi b/doc/guix.texi
index 4f9427ccbdb..b1bc1029bf3 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -21033,6 +21033,17 @@ is a string. This service is included in
@code{operating-system} by
default
(@pxref{operating-system-essential-services,@code{essential-services}}).
@end defvar
+@defvar domain-name-service-type
+Type of the service that sets the system @acronym{NIS,
+Network Information Service} domain name, whose value
+is a string.
+
+Note that this is not related to the more popular @acronym{DNS,
+Domain Name System} domain name, use @code{host-name-service-type} for that,
+@pxref{Host Identification,,, libc, The GNU C Library Reference Manual}
+for more information.
+@end defvar
+
@defvar console-font-service-type
Install the given fonts on the specified ttys (fonts are per
virtual console on the kernel Linux). The value of this service is a list of
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index 81e1d14e448..be9480b2ab4 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -125,6 +125,7 @@
swap-service
host-name-service ; deprecated
host-name-service-type
+ domain-name-service-type
%default-console-font
console-font-service-type
console-font-service
@@ -873,6 +874,19 @@ host names."
"Return a service that sets the host name to @var{name}."
(service host-name-service-type name))
+(define domain-name-service-type
+ (shepherd-service-type
+ 'domain-name
+ (lambda (name)
+ (shepherd-service
+ (documentation "Initialize the machine's domain name.")
+ (provision '(domain-name))
+ (start #~(lambda _
+ (setdomainname #$name)
+ #$name))
+ (one-shot? #t)))
+ (description "Initialize the machine's domain name.")))
+
(define virtual-terminal-service-type
;; Ensure that virtual terminals run in UTF-8 mode. This is the case by
;; default with recent Linux kernels, but this service allows us to ensure