unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Marc Coquand <marc@coquand.email>
To: help-guix@gnu.org
Subject: Prepend string to "file" in G-expression
Date: Wed, 11 Dec 2024 09:43:52 +0200	[thread overview]
Message-ID: <87frmuekav.fsf@coquand.email> (raw)


Heya, I'm trying to grok g-expressions and setting up a small guile
program that sends an email.

I have the following

(define notify-mail-gexp
  (with-imported-modules
   '((guix build utils))
   #~(begin
       (use-modules
	(guix build utils))
       (let* ((msmtp-bin #$(file-append msmtp "/bin/msmtp"))
	      (run-number (getenv "RUN"))
	      (result (getenv "RESULT"))
	      (job-name (getenv "JOB"))
	      (password-eval-command
	       (string-append
               "--password-eval=" #$coreutils "/bin/cat"))) ;; more to come later
	 (invoke msmtp-bin
		 "--user=\"me@address\""
		 password-eval-command
		 "-t"
		 "--read-envelope-from"
		 "--set-from-header=\"auto\""
		 (result-email job-name run-number result))))))

(program-file "notify-mail" notify-mail-gexp)

What I struggle with is the correct incantation to build an argument to
invoke that looks like this:

--password-eval=/gnu/blahblah/bin/cat some-file

And I'd love any kind of directions for how I'm supposed to write this
correctly.

Thanks in advance


-- 
Marc


             reply	other threads:[~2024-12-11  7:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11  7:43 Marc Coquand [this message]
     [not found] <87r06esal7.fsf@rdklein.fr>
2024-12-11 12:40 ` Prepend string to "file" in G-expression Marc Coquand
2024-12-11 19:40   ` Felix Lechner via
2024-12-12 11:27     ` Marc Coquand

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=87frmuekav.fsf@coquand.email \
    --to=marc@coquand.email \
    --cc=help-guix@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.
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).