GNU bug report logs - #68857
gnu: home: dotfiles: Avoid creating extra directory in $HOME.

Previous Next

Package: guix-patches;

Reported by: paul <goodoldpaul <at> autistici.org>

Date: Wed, 31 Jan 2024 22:17:02 UTC

Severity: normal

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #47 received at 68857 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Giacomo Leidi <goodoldpaul <at> autistici.org>
Cc: paren <at> disroot.org, 68857 <at> debbugs.gnu.org, Andrew Tropin <andrew <at> trop.in>
Subject: Re: bug#68857: gnu: home: dotfiles: Avoid creating extra directory
 in $HOME.
Date: Mon, 04 Mar 2024 16:46:35 +0100
Hi,

Giacomo Leidi <goodoldpaul <at> autistici.org> skribis:

> The current implementation of the home-dotfiles-service-type contradicts
> the Guix manual (see https://issues.guix.gnu.org/68848 ). This patch
> properly implements both the plain and Stow dotfiles directory layouts.
>
> It does so by refactoring home-dotfiles-configuration, renaming the
> directories field to a single directory, adding a new packages field to
> support GNU Stow's users workflow and introducing a new layout field to
> switch between the two directory layouts.
>
> * gnu/home/services/dotfiles (home-dotfiles-configuration): Migrate to
> (gnu services configuration);
> [directories]: rename to...;
> [directory]: ...this, new field;
> [packages]: new field;
> [layout]: new field;
> (strip-stow-dotfile): new variable;
> (strip-plain-dotfile): new variable;
> (home-dotfiles-configuration->files): use the new fields;
> [directory-contents]: allow for
> selecting a subset of application dotfile directories;
> * doc/guix.texi: document the new layouts.
>
> Change-Id: I2e96037608353e360828290f055ec5271cfdfd48

LGTM, but…

> -  (directories       home-dotfiles-configuration-directories       ;list of strings
> -                     (default '()))

[...]

> +  (directory
> +   (string)
> +   "The dotfiles directory where @code{home-dotfiles-service-type}
> +will look for application dotfiles.")

This is an incompatible change.  Can we keep the old ‘directories’
field?

(Maybe this change is worthwhile, but it’s beyond the scope of this
patch series IMO, so I’d suggest discussing it separately.)

>  (define-public home-dotfiles-service-type
>    (service-type (name 'home-dotfiles)
>                  (extensions
>                   (list (service-extension home-files-service-type
> -                                          home-dotfiles-configuration->files)))
> -                (default-value (home-dotfiles-configuration))
> +                                          (lambda (config)
> +                                            (when config
> +                                              (home-dotfiles-configuration->files config))))))
> +                (default-value #f)

Better not provide a default value than provide one that is invalid.  My
suggestion would be to remove the ‘default-value’ field here.

Apologies for the delays and thanks for your work and for your patience!

Ludo’.




This bug report was last modified 1 year and 78 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.