summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-11-30 18:42:27 +0100
committerLudovic Courtès <ludo@gnu.org>2019-12-07 00:59:56 +0100
commiteaabc5e87f4e48d7bce88ca231f5fc2d554ca3d6 (patch)
tree9f9d300bc392a632765bf1e2e4b830307c1167ca
parentb85836d3067a0faccc945d584dfb88cf557eee97 (diff)
machine: Add provenance tracking to each machine operating system.
* gnu/machine.scm (<machine>): Rename accessor to '%machine-operating-system'. (machine-operating-system): New procedure. * doc/guix.texi (Service Reference): Mention it.
-rw-r--r--doc/guix.texi4
-rw-r--r--gnu/machine.scm7
2 files changed, 8 insertions, 3 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index bd7cb7a3da8..4c2ecd4b84d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -27129,8 +27129,8 @@ comparison less trivial.
27129@end quotation 27129@end quotation
27130 27130
27131This service is automatically added to your operating system 27131This service is automatically added to your operating system
27132configuration when you use @command{guix system reconfigure} or 27132configuration when you use @command{guix system reconfigure},
27133@command{guix system init}. 27133@command{guix system init}, or @command{guix deploy}.
27134@end defvr 27134@end defvr
27135 27135
27136@node Shepherd Services 27136@node Shepherd Services
diff --git a/gnu/machine.scm b/gnu/machine.scm
index 05b03b21d49..b342fe21440 100644
--- a/gnu/machine.scm
+++ b/gnu/machine.scm
@@ -93,11 +93,16 @@
93 make-machine 93 make-machine
94 machine? 94 machine?
95 this-machine 95 this-machine
96 (operating-system machine-operating-system) ; <operating-system> 96 (operating-system %machine-operating-system); <operating-system>
97 (environment machine-environment) ; symbol 97 (environment machine-environment) ; symbol
98 (configuration machine-configuration ; configuration object 98 (configuration machine-configuration ; configuration object
99 (default #f))) ; specific to environment 99 (default #f))) ; specific to environment
100 100
101(define (machine-operating-system machine)
102 "Return the operating system of MACHINE."
103 (operating-system-with-provenance
104 (%machine-operating-system machine)))
105
101(define (machine-display-name machine) 106(define (machine-display-name machine)
102 "Return the host-name identifying MACHINE." 107 "Return the host-name identifying MACHINE."
103 (operating-system-host-name (machine-operating-system machine))) 108 (operating-system-host-name (machine-operating-system machine)))