diff options
| author | Rutherther <rutherther@ditigal.xyz> | 2025-09-21 21:20:09 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-10-21 16:30:23 +0200 |
| commit | 4641d4bb8eab7d05b4915d20361d1902e1499d33 (patch) | |
| tree | c8182ef829ce78c5a78330c90fccf147c79dd032 /gnu/system | |
| parent | 17f14d45f78ba87ff21c0f625613a8faa3523b6d (diff) | |
vm-image.tmpl: Do not leak local checkout URL.
Follow up of 94c9e53fa4 that made similar change, but in
gnu/system/install.scm.
Change local checkout url for the default channel url to ensure release images
will not leak local checkout url.
* gnu/system/examples/vm-image.tmpl: Change channel of
‘guix’ package to inherit from ‘%default-guix-channel’.
Change-Id: I1c633b44cfa067cae1d2948e7e7ef6922995c27d
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/system')
| -rw-r--r-- | gnu/system/examples/vm-image.tmpl | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/gnu/system/examples/vm-image.tmpl b/gnu/system/examples/vm-image.tmpl index 205ae73a9fc..d3e70642b9e 100644 --- a/gnu/system/examples/vm-image.tmpl +++ b/gnu/system/examples/vm-image.tmpl | |||
| @@ -5,7 +5,12 @@ | |||
| 5 | ;; guix system reconfigure /etc/config.scm | 5 | ;; guix system reconfigure /etc/config.scm |
| 6 | ;; | 6 | ;; |
| 7 | 7 | ||
| 8 | (use-modules (gnu) (guix) (srfi srfi-1)) | 8 | (use-modules (gnu) |
| 9 | (guix) | ||
| 10 | (srfi srfi-1) | ||
| 11 | (ice-9 match) | ||
| 12 | (guix channels) | ||
| 13 | (gnu system image)) | ||
| 9 | (use-service-modules desktop mcron networking spice ssh xorg sddm) | 14 | (use-service-modules desktop mcron networking spice ssh xorg sddm) |
| 10 | (use-package-modules bootloaders fonts | 15 | (use-package-modules bootloaders fonts |
| 11 | package-management xdisorg xorg) | 16 | package-management xdisorg xorg) |
| @@ -25,6 +30,15 @@ Run '\x1b[1;37minfo guix\x1b[0m' to browse documentation. | |||
| 25 | accounts.\x1b[0m | 30 | accounts.\x1b[0m |
| 26 | ")) | 31 | ")) |
| 27 | 32 | ||
| 33 | (define (guix-package-commit guix) | ||
| 34 | ;; Extract the commit of the GUIX package. | ||
| 35 | (match (package-source guix) | ||
| 36 | ((? channel? source) | ||
| 37 | (channel-commit source)) | ||
| 38 | (_ | ||
| 39 | (apply (lambda* (#:key commit #:allow-other-keys) commit) | ||
| 40 | (package-arguments guix))))) | ||
| 41 | |||
| 28 | (operating-system | 42 | (operating-system |
| 29 | (host-name "gnu") | 43 | (host-name "gnu") |
| 30 | (timezone "Etc/UTC") | 44 | (timezone "Etc/UTC") |
| @@ -123,7 +137,14 @@ root ALL=(ALL) ALL | |||
| 123 | (guix-service-type config => | 137 | (guix-service-type config => |
| 124 | (guix-configuration | 138 | (guix-configuration |
| 125 | (inherit config) | 139 | (inherit config) |
| 126 | (guix (current-guix)))))))) | 140 | (guix |
| 141 | (let ((guix (current-guix))) | ||
| 142 | (package | ||
| 143 | (inherit guix) | ||
| 144 | ;; Do not leak the local checkout URL. | ||
| 145 | (source (channel | ||
| 146 | (inherit %default-guix-channel) | ||
| 147 | (commit (guix-package-commit guix))))))))))))) | ||
| 127 | 148 | ||
| 128 | ;; Allow resolution of '.local' host names with mDNS. | 149 | ;; Allow resolution of '.local' host names with mDNS. |
| 129 | (name-service-switch %mdns-host-lookup-nss)) | 150 | (name-service-switch %mdns-host-lookup-nss)) |
