unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Calling gpg encrypt inside mixed-text-file
@ 2022-10-14  8:40 Reza Housseini
  2022-10-14  8:55 ` (
  0 siblings, 1 reply; 3+ messages in thread
From: Reza Housseini @ 2022-10-14  8:40 UTC (permalink / raw)
  To: help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 618 bytes --]

Hi list

In a system configuration I won't to add a password file from a gpg 
encrypted file in the following manner:

(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?

Best

-- 
Reza Housseini

This message is signed with my GnuPG key:

     C0F3 0812 9AF2 80F4 0830 C2C1 C375 C6AF 0512 5C52

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 15557 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: Calling gpg encrypt inside mixed-text-file
  2022-10-14  8:40 Calling gpg encrypt inside mixed-text-file Reza Housseini
@ 2022-10-14  8:55 ` (
  2022-10-17  7:31   ` Reza Housseini
  0 siblings, 1 reply; 3+ messages in thread
From: ( @ 2022-10-14  8:55 UTC (permalink / raw)
  To: Reza Housseini, help-guix

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

    -- (


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

* Re: Calling gpg encrypt inside mixed-text-file
  2022-10-14  8:55 ` (
@ 2022-10-17  7:31   ` Reza Housseini
  0 siblings, 0 replies; 3+ messages in thread
From: Reza Housseini @ 2022-10-17  7:31 UTC (permalink / raw)
  To: (, help-guix


[-- Attachment #1.1.1: Type: text/plain, Size: 917 bytes --]

> 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
> 


Thanks for your pointers, will try if I can fiddle something together!

Best,
Reza

-- 
Reza Housseini

This message is signed with my GnuPG key:

     C0F3 0812 9AF2 80F4 0830 C2C1 C375 C6AF 0512 5C52

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 15557 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2022-10-17  7:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-14  8:40 Calling gpg encrypt inside mixed-text-file Reza Housseini
2022-10-14  8:55 ` (
2022-10-17  7:31   ` Reza Housseini

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).