Here's the code I have for /etc/os-release. I defined %os-release-file at the top to keep my actual services list a bit shorter. The '@' notation is a short-cut to not need to actually import (guix packages) or (gnu packages package-management) in my config.
Then later when adding the other services the 'simple-service' can just
be added in and it'll be combined with the other 'etc-service-type'
services to create a unified /etc.
(define %os-release-file
(plain-file "os-release"
(string-append
"NAME=\"Guix System\"\n"
"PRETTY_NAME=\"Guix System\"\n"
"VERSION=\""((@ (guix packages) package-version) (@ (gnu
packages package-management) guix))"\"\n"
"ID=guix\n"
"HOME_URL=\"https://www.gnu.org/software/guix/\"\n"
"SUPPORT_URL=\"https://www.gnu.org/software/guix/help/\"\n"
"BUG_REPORT_URL=\"mailto:[email protected]\"\n")))
(simple-service 'os-release etc-service-type
`(("os-release" ,%os-release-file)))
and here's what it looks like:
efraim@E5400 ~$ cat /etc/os-release
NAME="Guix System"
PRETTY_NAME="Guix System"
VERSION="1.0.1-6.0ed97e6"
ID=guix
HOME_URL="https://www.gnu.org/software/guix/"
SUPPORT_URL="https://www.gnu.org/software/guix/help/"
BUG_REPORT_URL="mailto:[email protected]"
--
Efraim Flashner <[email protected]> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
signature.asc
Description: PGP signature
