help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Prepend string to "file" in G-expression


From: Marc Coquand
Subject: Prepend string to "file" in G-expression
Date: Wed, 11 Dec 2024 09:43:52 +0200

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 via email to

[Prev in Thread] Current Thread [Next in Thread]