unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Viewing derivation output in the store
@ 2022-04-20 15:40 Brian Cully
  2022-04-20 19:42 ` Maxime Devos
  0 siblings, 1 reply; 5+ messages in thread
From: Brian Cully @ 2022-04-20 15:40 UTC (permalink / raw)
  To: guix-devel


	I apologize if this isn’t the right place to ask these
questions. While this is on the level of beginner tutorial (or should
be, IMHO), the devel list seemed the most relevant.

	I’m trying to figure out how I can create a file and view it in
the store before installation. I’d like to make sure the target looks
the way I want before putting it in its final location. I would like to
do this entirely within a Geiser session, rather than having to call
shell commands for ease of edit-test-debug cycles and tracing.

	This is also for pedagogical purposes; I’m trying to learn how
Guix goes from abstract file-like-object to an actual file. I’m still
new to basically everything here, and exercises like this help me learn.

	So, given the following:

---[snip]---
(use-modules (guix)
             (guix gexp)
             (guix monads)
             (gnu))

(define test-file (plain-file "foo.txt" "the contents of foo"))
(define test-gexp #~(begin #$test-file))
(define test-drv (gexp->derivation "foo" test-gexp))
---[snip]---

	How do I go from the derivation in ’test-drv’ to the output in
the store? Something like how, from the REPL, this works:

---[snip]---
scheme@(guile-user)> ,enter-store-monad
store-monad@(guile-user) [1]> (text-file "foo" "hello")
$34 = "/gnu/store/mnzh1q6ilbw0bg04dg0vc4f47laz57lg-foo"
---[snip]---

	Now I can easily open the path to ’/gnu/store/…foo’ to verify
the contents are correct.

NB: While I’m using ’plain-file’ here and its conents are obvious, this
is just to keep things simple. My actual target comes from
’computed-file’.

-bjc


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-04-28  7:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20 15:40 Viewing derivation output in the store Brian Cully
2022-04-20 19:42 ` Maxime Devos
2022-04-21  7:44   ` Josselin Poiret
2022-04-21 11:50     ` Brian Cully
2022-04-28  7:30     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).