guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#60521] [PATCH] home: Add home-stow-migration-service.


From: Sergey Trofimov
Subject: [bug#60521] [PATCH] home: Add home-stow-migration-service.
Date: Sat, 27 Jan 2024 21:21:02 +0100
User-agent: mu4e 1.10.8; emacs 29.1

Ludovic Courtès <ludo@gnu.org> writes:

Hi!

Giacomo Leidi <goodoldpaul@autistici.org> skribis:

* gnu/home/services.scm (dotfiles-for-app): New variable;
(home-stow-migration-configuration): new variable;
(home-stow-migration-service): new variable.
* doc/guix.texi: Document it.

That looks very useful!

Does it really warrant a new service, when what's needed is a procedure which traverses a directory recursively and returns a list of file-likes?

I have this in my home.scm:

--8<---------------cut here---------------start------------->8---
(define (del-prefix p str)
 (if (string-prefix? p str)
     (substring/shared str (string-length p))
     str))

(define* (as-local-files dir #:optional (trim-prefix dir))
 (let ((absolute-dir (string-append (getcwd) "/" dir))
       (to-trim (string-append (getcwd) "/" trim-prefix "/")))
   (map (lambda (fn)
          (list
           (del-prefix to-trim fn)
(local-file (canonicalize-path fn) (del-prefix "." (basename fn)) #:recursive? #t)))
        (find-files absolute-dir))))

(simple-service 'configs
               home-files-service-type
               append!
(with-directory-excursion (current-source-directory)
               `(,@(as-local-files "../backup")
                 ,@(as-local-files "../android")
                 ,@(as-local-files "../email")
                 ,@(as-local-files "../xsession")
                 ,@(as-local-files "../git")
                 ,@(as-local-files "../qutebrowser")
                 ,@(as-local-files "../desktop"))))
--8<---------------cut here---------------end--------------->8---

And the only need for this snippet is because there are filenames starting with dot and they can't be put in store as is.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]