diff --git a/modules/rosenthal/services/desktop.scm b/modules/rosenthal/services/desktop.scm index 82b9f07..466a8a3 100644 --- a/modules/rosenthal/services/desktop.scm +++ b/modules/rosenthal/services/desktop.scm @@ -597,20 +597,12 @@ gtk-key-theme-name = ~a~%" ,(local-file "../examples/dot-config/wezterm/wezterm.lua")) ;; Prevent Noctalia shell initial screen. (".cache/noctalia/shell-state.json" - ,(computed-file "noctalia-shell-state.json" - (with-extensions (list guile-json-4) - #~(begin - (use-modules (json)) - (call-with-output-file #$output - (lambda (port) - (scm->json - `(("changelogState" - ("lastSeenVersion" - . ,(string-append "v" #$(package-version noctalia-shell)))) - ("telemetry" - ("instanceId" . ""))) - port - #:pretty #t))))))) + ,(json-file "noctalia-shell-state.json" + #~'(("changelogState" + ("lastSeenVersion" + . #$(string-append "v" (package-version noctalia-shell)))) + ("telemetry" + ("instanceId" . ""))))) ,@%rosenthal-skeletons)) diff --git a/modules/rosenthal/utils/file.scm b/modules/rosenthal/utils/file.scm index 5f5732d..56c293a 100644 --- a/modules/rosenthal/utils/file.scm +++ b/modules/rosenthal/utils/file.scm @@ -7,12 +7,14 @@ ;; Utilities #:use-module (guix gexp) ;; Guix packages + #:use-module (gnu packages guile) #:use-module (gnu packages guile-xyz) #:export (computed-substitution-with-inputs file-content hidden-desktop-entry ini-file + json-file yaml-file)) ;; XXX: ‘substitute*’ doesn't fully support Unicode: @@ -67,6 +69,17 @@ format." (call-with-output-file #$output (cut scm->ini #$exp #:port <>)))))) +;; https://github.com/aconchillo/guile-json +(define (json-file name exp) + "Return file-like object NAME, serialized from G-expression EXP in JSON +format." + (computed-file name + (with-extensions (list guile-json-4) + #~(begin + (use-modules (srfi srfi-26) (json)) + (call-with-output-file #$output + (cut scm->json #$exp <> #:pretty #t)))))) + ;; https://gitlab.com/yorgath/guile-yamlpp (define (yaml-file name exp) "Return file-like object NAME, serialized from G-expression EXP in YAML