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: Mon, 29 Jan 2024 14:40:29 +0100
User-agent: mu4e 1.10.8; emacs 29.1


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

Sergey Trofimov <sarg@sarg.org.ru> skribis:

(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))))

As you saw, I proposed a different solution: capturing
(current-source-directory) in ‘home-dotfiles-configuration’ and using
that to compute absolute file names (without ever calling
‘canonicalize-path’).

Using ‘getcwd’ would be incorrect or at least surprising: it would resolve file names relative to the current directory instead of relative
to the directory that contains the source file.


Sure, in my config I use `with-directory-excursion`, so `getcwd` returns correct values.

Anyway, the reason I replied was that I am also a former Stow user and in my eyes we should've extended existing `home-files-service-type` instead of making a specialized new one. If you check `stow` manual (https://www.gnu.org/software/stow/manual/html_node/Invoking-Stow.html#Invoking-Stow), it should be invoked with the names of packages to be installed/removed. `home-dotfiles-service` doesn't have a parameter for the list of packages and assumes that everything in the specified directory should be installed, a limitation that prevents me to start using it. In my dotfiles I have optional packages which I install depending on OS or machine's purpose. Sure the service could be amended with the said parameter, but why adding a new service when a more generic one exists and is fitting the use case?





reply via email to

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