utils: Add ‘hidden-desktop-entry’.

* modules/rosenthal/utils/file.scm (hidden-desktop-entry): New procedure.
This commit is contained in:
Hilton Chain committed 2025-06-27 21:48:47 +08:00
1 parent dc6ed8b930
commit 8c1b2e9c61
1 file changed
+15 -1
+15 -1
View File
@@ -5,7 +5,11 @@
#:use-module (ice-9 textual-ports)
#:use-module (guix gexp)
#:export (computed-substitution-with-inputs
file-content))
file-content
hidden-desktop-entry))
;; XXX: ‘substitute*’ doesn't fully support Unicode:
;; https://codeberg.org/guix/guix/src/commit/a88d6a45e422cede96d57d7a953439dc27c6a50c/guix/build/utils.scm#L964
(define (computed-substitution-with-inputs name file inputs)
(with-imported-modules '((guix build utils))
@@ -20,3 +24,13 @@
(define (file-content file)
(call-with-input-file (canonicalize-path file) get-string-all))
(define (hidden-desktop-entry name file)
(computed-file name
(with-imported-modules '((guix build utils))
#~(begin
(use-modules (guix build utils))
(copy-file #$file #$output)
(substitute* #$output
(("[Desktop Entry]" all)
(string-append all "NoDisplay=true\n")))))))