system: Export 'local-host-aliases'.
* gnu/system.scm (local-host-aliases): New procedure. (default-/etc/hosts): Use it.
This commit is contained in:
parent
c28ba7aa60
commit
568841d491
|
@ -75,6 +75,7 @@
|
||||||
operating-system-profile
|
operating-system-profile
|
||||||
operating-system-grub.cfg
|
operating-system-grub.cfg
|
||||||
|
|
||||||
|
local-host-aliases
|
||||||
%setuid-programs
|
%setuid-programs
|
||||||
%base-packages
|
%base-packages
|
||||||
|
|
||||||
|
@ -318,11 +319,14 @@ explicitly appear in OS."
|
||||||
"
|
"
|
||||||
This is the GNU system. Welcome.\n")
|
This is the GNU system. Welcome.\n")
|
||||||
|
|
||||||
|
(define (local-host-aliases host-name)
|
||||||
|
"Return aliases for HOST-NAME, to be used in /etc/hosts."
|
||||||
|
(string-append "127.0.0.1 localhost " host-name "\n"
|
||||||
|
"::1 localhost " host-name "\n"))
|
||||||
|
|
||||||
(define (default-/etc/hosts host-name)
|
(define (default-/etc/hosts host-name)
|
||||||
"Return the default /etc/hosts file."
|
"Return the default /etc/hosts file."
|
||||||
(text-file "hosts"
|
(text-file "hosts" (local-host-aliases host-name)))
|
||||||
(string-append "127.0.0.1 localhost " host-name "\n"
|
|
||||||
"::1 localhost " host-name "\n")))
|
|
||||||
|
|
||||||
(define* (etc-directory #:key
|
(define* (etc-directory #:key
|
||||||
(locale "C") (timezone "Europe/Paris")
|
(locale "C") (timezone "Europe/Paris")
|
||||||
|
|
Loading…
Reference in New Issue