~abcdw/rde

34fd2a3903734c643e029ed4baf92a356ecc39a6 — Xinglu Chen 4 months ago 325ab30
gnu: home-services: Don’t start paths with “/” for ‘run-on-change’ service.

* gnu/home-services.scm (compute-on-change-gexp): Don’t make the path
start with “/”, this is to make it more consistent with the
‘home-files’ service.
* gnu/home-services/fontutils.scm (regenerate-font-cache-gexp): Adjust
accordingly.
* gnu/home-services/xorg.scm (home-xresources-run-on-change-service):
Likewise.

Suggested-by: Andrew Tropin <andrew@trop.in>
3 files changed, 7 insertions(+), 9 deletions(-)

M gnu/home-services.scm
M gnu/home-services/fontutils.scm
M gnu/home-services/xorg.scm
M gnu/home-services.scm => gnu/home-services.scm +5 -7
@@ 329,7 329,8 @@ identical to the ones for the old generation."
          ;; is specified as the path in `gexp-tuples'.
          (define path-from-generation-dir
            (let ((dir-length (string-length new-generation)))
              (string-drop dir dir-length)))
              ;; Also drop starting "/"
              (string-drop dir (+ dir-length 1))))

          (define (filter-file-tree-node node)
            (if (eq? (car node) 'dir)


@@ 354,8 355,8 @@ identical to the ones for the old generation."
for the old generation.  If they aren't, return FILE with
the, otherwise, return @code{#f}.  This also works if the FILE is a
directory and the directory itself is a symlink to the store."
          (let ((new-file (string-append new-generation file))
                (old-file (string-append old-generation file)))
          (let ((new-file (string-append new-generation "/" file))
                (old-file (string-append old-generation "/" file)))
            (cond
             ;; If the files don't exist in either generation, don't
             ;; do anything.


@@ 375,10 376,7 @@ directory and the directory itself is a symlink to the store."
                  #f
                  file))
             (else
              (begin
                (newline)

                (check-directory new-file))))))
              (check-directory new-file)))))

        (when (and old-generation (file-exists? old-generation))
          (let* ((changed-files

M gnu/home-services/fontutils.scm => gnu/home-services/fontutils.scm +1 -1
@@ 28,7 28,7 @@
;; TODO: fc-cache -f is too slow, it can be called only on-change or
;; workarounded some other way.
(define (regenerate-font-cache-gexp _)
  #~("/profile/share/fonts"
  #~("profile/share/fonts"
      (begin
        (system* #$(file-append fontconfig
                                "/bin/fc-cache")

M gnu/home-services/xorg.scm => gnu/home-services/xorg.scm +1 -1
@@ 134,7 134,7 @@ URxvt.secondaryScroll: 0
  (list (home-xresources-configuration-package config)))

(define (home-xresources-run-on-change-service config)
  #~("/files/Xresources"
  #~("files/Xresources"
     (begin
       (display "Reloading Xresources\n")
       (system* #$(file-append (home-xresources-configuration-package config)