summaryrefslogtreecommitdiff
path: root/tw/gexp.scm
diff options
context:
space:
mode:
authorTimo Wilken2022-12-31 11:43:30 +0100
committerTimo Wilken2022-12-31 11:45:34 +0100
commitc629e4243330b5081c4b85563fe9c028e43310c2 (patch)
tree70558580c981cf85b0bb0fbbb26b78d4e3badd08 /tw/gexp.scm
parent54f0a727c312b82e5d1c25ca81b62344bbb56e10 (diff)
Extract theming files into separate module
Diffstat (limited to 'tw/gexp.scm')
-rw-r--r--tw/gexp.scm21
1 files changed, 21 insertions, 0 deletions
diff --git a/tw/gexp.scm b/tw/gexp.scm
new file mode 100644
index 00000000..2f1705b7
--- /dev/null
+++ b/tw/gexp.scm
@@ -0,0 +1,21 @@
+(define-module (tw gexp)
+ #:use-module (guix gexp)
+ #:use-module (guix modules))
+
+;; See also: `file-join' in (gnu home services ssh).
+(define-public (combined-text-file name . files)
+ "A file which is the concatenation of the contents of other files."
+ ;; We need to use #$output for `computed-file' to work.
+ ;; Of course this isn't documented anywhere!
+ (computed-file name
+ (with-imported-modules (source-module-closure
+ '((guix build utils))) ; for `dump-port'
+ #~(begin
+ (use-modules (guix build utils))
+ (call-with-output-file #$output
+ (lambda (oport)
+ (for-each (lambda (in-file)
+ (call-with-input-file in-file
+ (lambda (iport)
+ (dump-port iport oport))))
+ '#$files)))))))