summaryrefslogtreecommitdiff
path: root/guix/gexp.scm
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2015-06-10 17:50:27 -0400
committerMark H Weaver <mhw@netris.org>2015-06-10 17:50:27 -0400
commit14928016556300a6763334d4279c3d117902caaf (patch)
treed0dc262b14164b82f97dd6e896ca9e93a1fabeea /guix/gexp.scm
parent1511e0235525358abb52cf62abeb9457605b5093 (diff)
parent57cd353d87d6e9e6e882327be70b4d7b5ce863ba (diff)
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/gexp.scm')
-rw-r--r--guix/gexp.scm33
1 files changed, 32 insertions, 1 deletions
diff --git a/guix/gexp.scm b/guix/gexp.scm
index b08a361232..10056e5a1f 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -31,8 +31,17 @@
gexp-input
gexp-input?
+
local-file
local-file?
+ local-file-file
+ local-file-name
+ local-file-recursive?
+
+ plain-file
+ plain-file?
+ plain-file-name
+ plain-file-content
gexp->derivation
gexp->file
@@ -137,7 +146,7 @@ cross-compiling.)"
;;;
-;;; Local files.
+;;; File declarations.
;;;
(define-record-type <local-file>
@@ -166,6 +175,28 @@ This is the declarative counterpart of the 'interned-file' monadic procedure."
(($ <local-file> file name recursive?)
(interned-file file name #:recursive? recursive?))))
+(define-record-type <plain-file>
+ (%plain-file name content references)
+ plain-file?
+ (name plain-file-name) ;string
+ (content plain-file-content) ;string
+ (references plain-file-references)) ;list (currently unused)
+
+(define (plain-file name content)
+ "Return an object representing a text file called NAME with the given
+CONTENT (a string) to be added to the store.
+
+This is the declarative counterpart of 'text-file'."
+ ;; XXX: For now just ignore 'references' because it's not clear how to use
+ ;; them in a declarative context.
+ (%plain-file name content '()))
+
+(define-gexp-compiler (plain-file-compiler (file plain-file?) system target)
+ ;; "Compile" FILE by adding it to the store.
+ (match file
+ (($ <plain-file> name content references)
+ (text-file name content references))))
+
;;;
;;; Inputs & outputs.