aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRomain GARBAGE <romain.garbage@inria.fr>2025-04-08 16:07:00 +0200
committerLudovic Courtès <ludo@gnu.org>2025-04-08 17:23:27 +0200
commitc88f98bb3ca2616baea6b1e452cc900cc9c87503 (patch)
treea6003d4b2f602d7c078d0387a807ca3cddee61a0
parentac83a22375e4ba0b5c5d2c2f23ae301d64dc7170 (diff)
downloadguix-c88f98bb3ca2616baea6b1e452cc900cc9c87503.tar.gz
guix-c88f98bb3ca2616baea6b1e452cc900cc9c87503.zip
home: services: msmtp: Accept g-expressions for ‘password-eval’.
This allows users to specify: (password-eval #~(string-append #$(file-append libsecret "/bin/secret-tool") "…")) * gnu/home/services/mail.scm (string-or-gexp?): New variable. (maybe-string-or-gexp): New record type (msmtp-configuration-serialize-string-or-gexp): New variable. (msmtp-configuration) [password-eval]: Change type. Change-Id: Id3016956250c447b301b40f29a6509d57058be49 Signed-off-by: Ludovic Courtès <ludo@gnu.org>
-rw-r--r--gnu/home/services/mail.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/gnu/home/services/mail.scm b/gnu/home/services/mail.scm
index 5445c82c67..78d614dc84 100644
--- a/gnu/home/services/mail.scm
+++ b/gnu/home/services/mail.scm
@@ -49,9 +49,14 @@
msmtp-account-name
msmtp-account-configuration))
+(define (string-or-gexp? obj)
+ (or (string? obj)
+ (gexp? obj)))
+
(define-maybe string (prefix msmtp-configuration-))
(define-maybe boolean (prefix msmtp-configuration-))
(define-maybe integer (prefix msmtp-configuration-))
+(define-maybe string-or-gexp (prefix msmtp-configuration-))
;; Serialization of 'msmtp'.
(define (uglify-symbol field-name)
@@ -68,6 +73,9 @@
(define (msmtp-configuration-serialize-string field-name value)
#~(string-append #$(uglify-symbol field-name) " " #$value "\n"))
+(define msmtp-configuration-serialize-string-or-gexp
+ msmtp-configuration-serialize-string)
+
(define (msmtp-configuration-serialize-maybe-string-no-underscore field-name value)
#~(if #$(maybe-value-set? value)
(string-append
@@ -148,7 +156,7 @@ unless TLS without STARTTLS is used, in which case it is 465 (\"smtps\").")
"Set the envelope-from address.")
(password-eval
- maybe-string
+ maybe-string-or-gexp
"Set the password for authentication to the output (stdout) of the command cmd."
(serializer msmtp-configuration-serialize-maybe-string-no-underscore))
ae'>scripts: pack: Fix typo.Alex Griffin * guix/scripts/pack.scm (compressor-extenstion): Fix typo. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> 2022-04-23pack: Fix match error for multi-packages deb packs.Maxim Cournoyer * guix/scripts/pack.scm: Remove duplicated copyright line. (debian-archive)[single-entry]: Match one or anything, not one or zero. Reported-by: jgart <jgart@dismail.de> 2021-07-18Merge branch 'master' into core-updatesLudovic Courtès 2021-07-18pack: Streamline how files are included in tarballs.Maxim Cournoyer Thanks to Guillem Jover <guillem@debian.org> on the OFTC's #debian-dpkg channel for helping with troubleshooting. Letting GNU Tar recursively walk the complete files hierarchy side-steps the risks associated with providing a list of file names: 1. Duplicated files in the archive (recorded as hard links by GNU Tar) 2. Missing parent directories. The above would cause dpkg to malfunction, for example by aborting early and skipping triggers when there were missing parent directories. * guix/scripts/pack.scm (self-contained-tarball/builder): Do not call POPULATE-SINGLE-PROFILE-DIRECTORY, which creates extraneous files such as /root. Instead, call POPULATE-STORE and INSTALL-DATABASE-AND-GC-ROOTS individually to more precisely generate the file system. Replace the list of files by the current directory, "." and streamline the way options are passed. * gnu/system/file-systems.scm (reduce-directories): Remove procedure. * tests/file-systems.scm ("reduce-directories"): Remove test. 2021-07-18pack/deb: Add default section and priority fields to the control file.Maxim Cournoyer These fields, while optional per dpkg, are required by other tools such as reprepro, commonly used to generate apt repositories. * guix/scripts/pack.scm (debian-archive): Set the control file section field to 'misc' and the priority field to 'optional'. 2021-07-18pack: Allow embedding custom control files in deb packs.Maxim Cournoyer * guix/scripts/pack.scm (self-contained-tarball/builder) [extra-options]: New argument. (self-contained-tarball, squashfs-image, docker-image) (debian-archive): Likewise. Remove two TODO comments. Document EXTRA-OPTIONS. Use the custom control files when provided. (%deb-format-options): New variable. (show-deb-format-options, show-deb-format-options/detailed): New procedures. (%options): Register new options. (show-help): Augment with new usage. (guix-pack): Validate and propagate new argument values. * doc/guix.texi (Invoking guix pack)[deb]: Document how to list advanced options. Add an example. * tests/pack.scm (deb archive...): Provide extra-options to the debian-archive procedure, and validate that the provided files are embedded in the pack. 2021-06-29pack: Add support for the deb format.Maxim Cournoyer * .dir-locals.el (scheme-mode)[gexp->derivation]: Define indentation rule. * guix/scripts/pack.scm (debian-archive): New procedure. (%formats): Register the new deb format. (show-formats): Add it to the usage string. * tests/pack.scm (%ar-bootstrap): New variable. (deb archive with symlinks): New test. * doc/guix.texi (Invoking guix pack): Document it. * NEWS: Add news entry. 2021-06-29pack: Prevent duplicate files in tar archives.Maxim Cournoyer Tar translate duplicate files in the archive into hard links. These can cause problems, as not every tool support them; for example dpkg doesn't. * gnu/system/file-systems.scm (reduce-directories): New procedure. (file-prefix?): Lift the restriction on file prefix. The procedure can be useful for comparing relative file names. Adjust doc. (file-name-depth): New procedure, extracted from ... (btrfs-store-subvolume-file-name): ... here. * guix/scripts/pack.scm (self-contained-tarball/builder): Use reduce-directories. * tests/file-systems.scm ("reduce-directories"): New test. 2021-06-29pack: Improve naming of the packs store file names.Maxim Cournoyer Instead of just naming them by their pack type, add information from the package(s) they contain to make it easier to differentiate them. * guix/scripts/pack.scm (define-with-source): New macro. (manifest->friendly-name): Extract procedure from ... (docker-image): ... here, now defined via the above macro. Adjust REPOSITORY argument value accordingly. (guix-pack): Derive NAME using MANIFEST->FRIENDLY-NAME. 2021-06-29pack: Fix typo.Maxim Cournoyer * guix/scripts/pack.scm (self-contained-tarball/builder): Fix typo. 2021-06-29pack: Factorize base tar options.Maxim Cournoyer * guix/docker.scm (%tar-determinism-options): Move to a new module and rename to `tar-base-options'. Adjust references accordingly. * guix/build/pack.scm: New file. * Makefile.am (MODULES): Register it. * guix/scripts/pack.scm (self-contained-tarball/builder): Use it. 2021-06-29pack: Extract builder code from self-contained-tarball.Maxim Cournoyer This is made to allow reusing it for the debian-archive pack format, added in a subsequent commit. * guix/scripts/pack.scm (self-contained-tarball/builder): New procedure, containing the build code extracted from self-contained-tarball. (self-contained-tarball): Use the above procedure. 2021-06-19Merge branch 'master' into core-updatesMarius Bakke Note: this merge actually changes the 'curl' and 'python-attrs' derivations, as part of solving caf4a7a2770ef4d05a6e18f40d602e51da749ddc and 12964df69a99de6190422c752fef65ef813f3b6b respectively. 4604d43c0e (gnu: gnutls@3.6.16: Fix cross-compilation.) was ignored because it cannot currently be tested. Conflicts: gnu/local.mk gnu/packages/aidc.scm gnu/packages/boost.scm gnu/packages/curl.scm gnu/packages/nettle.scm gnu/packages/networking.scm gnu/packages/python-xyz.scm gnu/packages/tls.scm 2021-06-16pack: Fix the system value passed to build-docker-image.Maxim Cournoyer Before this change, the system value would be passed as x86_64 when using a i686-linux emulated system, e.g.: $ guix environment --system=i686-linux --ad-hoc guile -- \ guile -c '(display (utsname:machine (uname))) (newline)' x86_64 This change uses the Guile builtin %host-type variable, which doesn't have this problem: $ guix environment --system=i686-linux --ad-hoc guile -- \ guile -c '(display %host-type) (newline)' i686-unknown-linux-gnu * guix/scripts/pack.scm (docker-image)[#:system] Use %host-type as a fall-back when target is not defined. Co-authored-by: Ludovic Courtès <ludo@gnu.org>