unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Brian Cully <bjc@spork.org>
To: guix-devel@gnu.org
Subject: Viewing derivation output in the store
Date: Wed, 20 Apr 2022 11:40:43 -0400	[thread overview]
Message-ID: <87ee1rn1ph.fsf@ditto.jhoto.spork.org> (raw)


	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


             reply	other threads:[~2022-04-20 17:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-20 15:40 Brian Cully [this message]
2022-04-20 19:42 ` Viewing derivation output in the store Maxime Devos
2022-04-21  7:44   ` Josselin Poiret
2022-04-21 11:50     ` Brian Cully
2022-04-28  7:30     ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ee1rn1ph.fsf@ditto.jhoto.spork.org \
    --to=bjc@spork.org \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).