diff options
| author | Hilton Chain <hako@ultrarare.space> | 2026-01-17 16:44:34 +0800 |
|---|---|---|
| committer | Hilton Chain <hako@ultrarare.space> | 2026-01-25 13:07:34 +0800 |
| commit | e00439c93e097fe18f08f48e930aa1d6ad7d474c (patch) | |
| tree | d2305c00c35584bad35d1dd021f6c2078a442d67 /gnu/services | |
| parent | edb31b3c80f8c05f0e4ff0141e9a9ba99c7f0456 (diff) | |
services: guix: Pretty print /etc/guix/channels.scm.
* gnu/services/base.scm (install-channels-file): Pretty print channels.scm.
Change-Id: I692758a4f0a3f6e57b40c95a487c7c843245fe6c
Diffstat (limited to 'gnu/services')
| -rw-r--r-- | gnu/services/base.scm | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm index adda5ab9bb9..1117c761e84 100644 --- a/gnu/services/base.scm +++ b/gnu/services/base.scm | |||
| @@ -104,6 +104,7 @@ | |||
| 104 | #:use-module (srfi srfi-35) | 104 | #:use-module (srfi srfi-35) |
| 105 | #:use-module (ice-9 match) | 105 | #:use-module (ice-9 match) |
| 106 | #:use-module (ice-9 format) | 106 | #:use-module (ice-9 format) |
| 107 | #:use-module (ice-9 pretty-print) | ||
| 107 | #:re-export (user-processes-service-type ;backwards compatibility | 108 | #:re-export (user-processes-service-type ;backwards compatibility |
| 108 | %default-substitute-urls) | 109 | %default-substitute-urls) |
| 109 | #:export (fstab-service-type | 110 | #:export (fstab-service-type |
| @@ -1903,8 +1904,12 @@ archive' public keys, with GUIX." | |||
| 1903 | "Return a gexp with code to install CHANNELS, a list of channels, in | 1904 | "Return a gexp with code to install CHANNELS, a list of channels, in |
| 1904 | /etc/guix/channels.scm." | 1905 | /etc/guix/channels.scm." |
| 1905 | (define channels-file | 1906 | (define channels-file |
| 1906 | (scheme-file "channels.scm" | 1907 | (plain-file "channels.scm" |
| 1907 | `(list ,@(map channel->code channels)))) | 1908 | (call-with-output-string |
| 1909 | (lambda (port) | ||
| 1910 | (pretty-print | ||
| 1911 | `(list ,@(map channel->code channels)) | ||
| 1912 | port))))) | ||
| 1908 | 1913 | ||
| 1909 | (with-imported-modules '((guix build utils)) | 1914 | (with-imported-modules '((guix build utils)) |
| 1910 | #~(begin | 1915 | #~(begin |
