unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: "(" <paren@disroot.org>
To: "Reza Housseini" <reza.housseini@gmail.com>, <help-guix@gnu.org>
Subject: Re: Calling gpg encrypt inside mixed-text-file
Date: Fri, 14 Oct 2022 09:55:03 +0100	[thread overview]
Message-ID: <CNLIQGRCTQ3M.2BNL49XT7A9CV@guix-framework> (raw)
In-Reply-To: <2e8004f1-e30e-3b45-31e4-af75812d1e82@gmail.com>

Hey Reza,

On Fri Oct 14, 2022 at 9:40 AM BST, Reza Housseini wrote:
> (service radicale-service-type
> 			      (radicale-configuration
> 			       (config-file (mixed-text-file "radicale.conf" "
> [auth]
> type = htpasswd
> htpasswd_filename = " (local-file "my-password.gpg ") "
> htpasswd_encryption = plain
> "))))
>
> This obviously does not work, but how would I achieve to call gpg 
> --decrypt --quiet inside the mixed-text-file?

You'll need two things; ``computed-file'', and the ``(ice-9 popen)'' standard
library module. ``computed-file'' allows you to build a file-like object from
arbitrary code. Have a look here for an example from my configuration,

  https://git.sr.ht/~unmatched-paren/conf/tree/root/item/home.scm#L168

which removes all ``//'' comments from ``waybar.json'' before writing the
result to the store path.

Also see the Guix and Guile manuals on these two subjects,

  ``(ice-9 popen)'': https://www.gnu.org/software/guile/manual/html_node/Pipes.html
  ``computed-file'': https://guix.gnu.org/manual/en/html_node/G_002dExpressions.html#index-computed_002dfile

    -- (


  reply	other threads:[~2022-10-14  8:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-14  8:40 Calling gpg encrypt inside mixed-text-file Reza Housseini
2022-10-14  8:55 ` ( [this message]
2022-10-17  7:31   ` Reza Housseini

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=CNLIQGRCTQ3M.2BNL49XT7A9CV@guix-framework \
    --to=paren@disroot.org \
    --cc=help-guix@gnu.org \
    --cc=reza.housseini@gmail.com \
    /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).