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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: paul <goodoldpaul@HIDDEN>; dated Wed, 31 Jan 2024 22:17:02 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 68857 <at> debbugs.gnu.org:


Received: (at 68857) by debbugs.gnu.org; 27 Feb 2024 10:20:24 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 27 05:20:23 2024
Received: from localhost ([127.0.0.1]:40872 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1reuZT-0008Et-Br
	for submit <at> debbugs.gnu.org; Tue, 27 Feb 2024 05:20:23 -0500
Received: from eggs.gnu.org ([209.51.188.92]:38074)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1reuZQ-0008E3-UX
 for 68857 <at> debbugs.gnu.org; Tue, 27 Feb 2024 05:20:21 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1reuWL-0002kX-FW; Tue, 27 Feb 2024 05:17:09 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=Hn9SsLUzVo8lXbxPRcmz9WuyVBAbrof1bre2gHRED6E=; b=TnnzQBoEGknzFqfl+rCq
 HWFUOV/vqr/sBb92ChBwTPqocdFcOhKS4doYzTJFl9djg7Sj9gTJfm0Yha1BPNoW/KVsZpiddOvYA
 HTCMi6oJ4uUwHsxQDYIySwxY4FPGR99Or6izkZYiegdxjGhCITRn0sWNmc0Tf/zOkvaJv7JlI7pJ2
 CD+Y8X9DO7hCWgUChxQv11PNqCyKLLLvsInHrJJI1VNl+0e1q+kNZTAF8sUwUK7xXJnH55iZknYhC
 ztEd/97h69Vw3dIroS163JSwBjy12WtEA7Lbn1Nw67d4qfIlpej1VtMWbDkPnpXTNUNhBFZeQ/btz
 DJOx8ZKyYf44IA==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: paul <goodoldpaul@HIDDEN>
Subject: Re: bug#68857: gnu: home: dotfiles: Avoid creating extra directory
 in $HOME.
In-Reply-To: <24f9f59a-79e8-27bc-5fe4-da160ed64187@HIDDEN> (paul's
 message of "Tue, 20 Feb 2024 19:38:00 +0100")
References: <14bc720d-7fdc-516a-3018-58294c1cafcd@HIDDEN>
 <20240216171724.22171-1-goodoldpaul@HIDDEN>
 <87msrvmq7v.fsf_-_@HIDDEN>
 <24f9f59a-79e8-27bc-5fe4-da160ed64187@HIDDEN>
Date: Tue, 27 Feb 2024 11:17:07 +0100
Message-ID: <87bk82i53w.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68857
Cc: 68857 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi,

paul <goodoldpaul@HIDDEN> skribis:

> As I tried explaining in the commit message, this approach, compared
> to having a single field in home-dotfiles-configuration , allows for
> having different layouts for different directories and to carry
> additional information that might be needed for a given layout
> type. Such as the application field required to support some Stow's
> users workflows. What do you think about this approach? It should be
> general enough to support any kind of layout.

I think we=E2=80=99ll only want to support two layouts: Stow and =E2=80=9Cp=
lain=E2=80=9D; we
should avoid overengineering that.  That=E2=80=99s why a simple (layout 'st=
ow)
field seems good enough for me.

WDYT?

Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#68857; Package guix-patches. Full text available.

Message received at 68857 <at> debbugs.gnu.org:


Received: (at 68857) by debbugs.gnu.org; 20 Feb 2024 18:38:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 20 13:38:36 2024
Received: from localhost ([127.0.0.1]:46546 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rcV0m-0000r8-9M
	for submit <at> debbugs.gnu.org; Tue, 20 Feb 2024 13:38:36 -0500
Received: from confino.investici.org ([93.190.126.19]:51879)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <goodoldpaul@HIDDEN>) id 1rcV0h-0000qt-J4
 for 68857 <at> debbugs.gnu.org; Tue, 20 Feb 2024 13:38:34 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org;
 s=stigmate; t=1708454281;
 bh=EDoRqsb6NtegefhnC7jomG1czPzQcB9MojNbN3hoqRM=;
 h=Date:Subject:To:Cc:References:From:In-Reply-To:From;
 b=U/iZHJxl+jQYtYw5xyszPsUytbSXNO89HeF05Hbp16pSk+XVezKEwmh1mzYrv345a
 55OzuPrWO1EwzsBl4YB2LrNsIpy5CGqRAm9+AiJh4yBdvj7ZCXcgcIpxrSac6puYQ5
 nBDr7Iv6tE0Tcx8xmZp5MvMlufjbkdJGVVotsOHg=
Received: from mx1.investici.org (unknown [127.0.0.1])
 by confino.investici.org (Postfix) with ESMTP id 4TfSp12J3wz119q;
 Tue, 20 Feb 2024 18:38:01 +0000 (UTC)
Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19])
 (Authenticated sender: goodoldpaul@HIDDEN) by localhost (Postfix) with
 ESMTPSA id 4TfSp10Vghz119n; Tue, 20 Feb 2024 18:38:01 +0000 (UTC)
Message-ID: <24f9f59a-79e8-27bc-5fe4-da160ed64187@HIDDEN>
Date: Tue, 20 Feb 2024 19:38:00 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.15.0
Subject: Re: bug#68857: gnu: home: dotfiles: Avoid creating extra directory in
 $HOME.
Content-Language: en-US
To: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>
References: <14bc720d-7fdc-516a-3018-58294c1cafcd@HIDDEN>
 <20240216171724.22171-1-goodoldpaul@HIDDEN>
 <87msrvmq7v.fsf_-_@HIDDEN>
From: paul <goodoldpaul@HIDDEN>
In-Reply-To: <87msrvmq7v.fsf_-_@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: -5.9 (-----)
X-Debbugs-Envelope-To: 68857
Cc: 68857 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.9 (------)

Hi Ludo’ ,

On 2/20/24 10:37, Ludovic Courtès wrote:
> Hello Giacomo!
>
> Giacomo Leidi <goodoldpaul@HIDDEN> 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 creating a new record type for each directory layout. This
>> approach, compared to having a single field in
>> home-dotfiles-configuration,
>> allows for having different layouts for different directories and to
>> carry additional information that might be required for some layouts.
>>
>> Implementing a new layout should just be a matter of creating a new
>> record type, defining a strip-*-dotfile procedure and plugging them into
>> the home-dotfiles-service-type.
>>
>> * gnu/home/services/dotfiles (home-dotfiles-stow-directory): New
>> variable;
>> (home-dotfiles-plain-directory): new variable;
>> (home-dotfiles-configuration): migrate to (gnu services configuration);
>> (strip-stow-dotfile): new variable;
>> (strip-plain-dotfile): new variable;
>> (home-dotfiles-configuration->files): use the new record types;
>> [directory-contents]: allow for
>> selecting a subset of application dotfile directories;
>> * doc/guix.texi: document the new layouts.
>>
>> Change-Id: I2e96037608353e360828290f055ec5271cfdfd48
> Thanks for working on it!
>
>> +There are two supported dotfiles directory layouts, for now. The
>> +@code{home-dotfiles-plain-directory} layout, which is structured as follows:
>> +
>> +@example
>> +~$ tree -a ./dotfiles/
>> +dotfiles/
>> +├── .gitconfig
>> +├── .gnupg
>> +│   ├── gpg-agent.conf
>> +│   └── gpg.conf
>> +├── .guile
>> +├── .config
>> +│   ├── guix
>> +│   │   └── channels.scm
>> +│   └── nixpkgs
>> +│       └── config.nix
>> +├── .nix-channels
>> +├── .tmux.conf
>> +└── .vimrc
>> +@end example
> I’d add a sentence like: “This tree structure is installed as is to the
> home directory upon @command{guix home reconfigure}.”
I'm adding this to the manual, thanks!
>> +(define-configuration/no-serialization home-dotfiles-configuration
> I think we should keep ‘home-dotfiles-configuration’ for compatibility
> (this patch keeps the exports but removes the actual
> <home-dotfiles-configuration> definition IIUC).
We are keeping home-dotfiles-configuration , it's just now it is 
implemented with validation from (gnu services configuration) . The only 
thing changing is that home-dotfiles-configuration's directories field 
is now a list of either home-dotfiles-plain-directory or 
home-dotfiles-stow-directory records.
> Also, as a rule of thumb, the configuration of a given service type is
> usually monomorphic (always the same configuration record type), which I
> find clearer.
>
> Instead of having these two record types, would it be an option to add a
> ‘type’ field (or similar) to <home-dotfiles-configuration>, as discussed
> earlier?

As I tried explaining in the commit message, this approach, compared to 
having a single field in home-dotfiles-configuration , allows for having 
different layouts for different directories and to carry additional 
information that might be needed for a given layout type. Such as the 
application field required to support some Stow's users workflows. What 
do you think about this approach? It should be general enough to support 
any kind of layout.

Thank you for your time,

giacomo





Information forwarded to guix-patches@HIDDEN:
bug#68857; Package guix-patches. Full text available.

Message received at 68857 <at> debbugs.gnu.org:


Received: (at 68857) by debbugs.gnu.org; 20 Feb 2024 09:37:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 20 04:37:43 2024
Received: from localhost ([127.0.0.1]:44290 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rcMZL-00038a-Bh
	for submit <at> debbugs.gnu.org; Tue, 20 Feb 2024 04:37:43 -0500
Received: from eggs.gnu.org ([209.51.188.92]:42708)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ludo@HIDDEN>) id 1rcMZI-00038I-Bl
 for 68857 <at> debbugs.gnu.org; Tue, 20 Feb 2024 04:37:41 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <ludo@HIDDEN>)
 id 1rcMYp-0007ZC-Mg; Tue, 20 Feb 2024 04:37:11 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=iaJYdtEiNKGhq+DapAK2FuwKvVkiCGvgCQm126fx4S4=; b=g7DzkYzfqENHBo9ygcOa
 bO2qo2WEUbW8CXQiGD5Hn4UV0iS3KT9dzZJ3aJtZVuIf5YgR/IZAoS5/GIt1PjGhyB/dwwOI9WjU+
 EVHj1w6JkNFlN1H/MQjlioFxtSwvyk0uq8z4ev9AUM+0bv38XL2V5unJrkwAoUhk4NJXMgeY2bE/d
 pNpy/lUmJTVGBWvATsuAo7gYR9SJWTrkwLeX9SOMkimSy46SJrvSsHFtDTI2FFg6wRw8qvyGw+9sZ
 /796fqtCAltVB+zVI3dLtaCVsRY1WR4q8zokXCDdFP1llwaJs34jD3oIP0hsTuOqmjxwTf0hpdJ5+
 rk7lH7TzCwxF9A==;
From: =?utf-8?Q?Ludovic_Court=C3=A8s?= <ludo@HIDDEN>
To: Giacomo Leidi <goodoldpaul@HIDDEN>
Subject: Re: bug#68857: gnu: home: dotfiles: Avoid creating extra directory
 in $HOME.
In-Reply-To: <20240216171724.22171-1-goodoldpaul@HIDDEN> (Giacomo
 Leidi's message of "Fri, 16 Feb 2024 18:17:19 +0100")
References: <14bc720d-7fdc-516a-3018-58294c1cafcd@HIDDEN>
 <20240216171724.22171-1-goodoldpaul@HIDDEN>
Date: Tue, 20 Feb 2024 10:37:08 +0100
Message-ID: <87msrvmq7v.fsf_-_@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -4.2 (----)
X-Debbugs-Envelope-To: 68857
Cc: 68857 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.2 (-----)

Hello Giacomo!

Giacomo Leidi <goodoldpaul@HIDDEN> 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 creating a new record type for each directory layout. This
> approach, compared to having a single field in
> home-dotfiles-configuration,
> allows for having different layouts for different directories and to
> carry additional information that might be required for some layouts.
>
> Implementing a new layout should just be a matter of creating a new
> record type, defining a strip-*-dotfile procedure and plugging them into
> the home-dotfiles-service-type.
>
> * gnu/home/services/dotfiles (home-dotfiles-stow-directory): New
> variable;
> (home-dotfiles-plain-directory): new variable;
> (home-dotfiles-configuration): migrate to (gnu services configuration);
> (strip-stow-dotfile): new variable;
> (strip-plain-dotfile): new variable;
> (home-dotfiles-configuration->files): use the new record types;
> [directory-contents]: allow for
> selecting a subset of application dotfile directories;
> * doc/guix.texi: document the new layouts.
>
> Change-Id: I2e96037608353e360828290f055ec5271cfdfd48

Thanks for working on it!

> +There are two supported dotfiles directory layouts, for now. The
> +@code{home-dotfiles-plain-directory} layout, which is structured as foll=
ows:
> +
> +@example
> +~$ tree -a ./dotfiles/
> +dotfiles/
> +=E2=94=9C=E2=94=80=E2=94=80 .gitconfig
> +=E2=94=9C=E2=94=80=E2=94=80 .gnupg
> +=E2=94=82   =E2=94=9C=E2=94=80=E2=94=80 gpg-agent.conf
> +=E2=94=82   =E2=94=94=E2=94=80=E2=94=80 gpg.conf
> +=E2=94=9C=E2=94=80=E2=94=80 .guile
> +=E2=94=9C=E2=94=80=E2=94=80 .config
> +=E2=94=82   =E2=94=9C=E2=94=80=E2=94=80 guix
> +=E2=94=82   =E2=94=82   =E2=94=94=E2=94=80=E2=94=80 channels.scm
> +=E2=94=82   =E2=94=94=E2=94=80=E2=94=80 nixpkgs
> +=E2=94=82       =E2=94=94=E2=94=80=E2=94=80 config.nix
> +=E2=94=9C=E2=94=80=E2=94=80 .nix-channels
> +=E2=94=9C=E2=94=80=E2=94=80 .tmux.conf
> +=E2=94=94=E2=94=80=E2=94=80 .vimrc
> +@end example

I=E2=80=99d add a sentence like: =E2=80=9CThis tree structure is installed =
as is to the
home directory upon @command{guix home reconfigure}.=E2=80=9D

> -(define-record-type* <home-dotfiles-configuration>
> -  home-dotfiles-configuration make-home-dotfiles-configuration
> -  home-dotfiles-configuration?
> -  (source-directory  home-dotfiles-configuration-source-directory
> -                     (default (current-source-directory))
> -                     (innate))
> -  (directories       home-dotfiles-configuration-directories       ;list=
 of strings
> -                     (default '()))
> -  (excluded          home-dotfiles-configuration-excluded       ;list of=
 strings
> -                     (default %home-dotfiles-excluded)))
> -
> -(define (import-dotfiles directory files)
> +(define list-of-strings?
> +  (list-of string?))
> +
> +(define-maybe list-of-strings)
> +
> +(define-configuration/no-serialization home-dotfiles-stow-directory

[...]

> +(define-configuration/no-serialization home-dotfiles-configuration

I think we should keep =E2=80=98home-dotfiles-configuration=E2=80=99 for co=
mpatibility
(this patch keeps the exports but removes the actual
<home-dotfiles-configuration> definition IIUC).

Also, as a rule of thumb, the configuration of a given service type is
usually monomorphic (always the same configuration record type), which I
find clearer.

Instead of having these two record types, would it be an option to add a
=E2=80=98type=E2=80=99 field (or similar) to <home-dotfiles-configuration>,=
 as discussed
earlier?

Thanks,
Ludo=E2=80=99.




Information forwarded to guix-patches@HIDDEN:
bug#68857; Package guix-patches. Full text available.

Message received at 68857 <at> debbugs.gnu.org:


Received: (at 68857) by debbugs.gnu.org; 16 Feb 2024 19:07:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 16 14:07:27 2024
Received: from localhost ([127.0.0.1]:60210 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rb3YU-0004Vh-Sq
	for submit <at> debbugs.gnu.org; Fri, 16 Feb 2024 14:07:27 -0500
Received: from mail-lf1-f50.google.com ([209.85.167.50]:53753)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sarg@HIDDEN>) id 1rb3YP-0004VQ-0J
 for 68857 <at> debbugs.gnu.org; Fri, 16 Feb 2024 14:07:24 -0500
Received: by mail-lf1-f50.google.com with SMTP id
 2adb3069b0e04-511898b6c9eso3006263e87.3
 for <68857 <at> debbugs.gnu.org>; Fri, 16 Feb 2024 11:07:01 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=sarg.org.ru; s=google; t=1708110355; x=1708715155; darn=debbugs.gnu.org;
 h=mime-version:message-id:in-reply-to:date:subject:cc:to:from
 :user-agent:references:from:to:cc:subject:date:message-id:reply-to;
 bh=WhaJXe2T3Wbb6tdsY5oB9gFTHOYpxXLCbPOjh1j270Y=;
 b=BTW6nQbGkl9YvQrvWFkyNqAEz7rOzOrjKW+C6XxlJZa4oPJbGHbLPCNQsXQzpUvBnv
 SWoo8lFv9GzOiDBdcnKgMjmKIORfH+1yoqa75zxbfRLoW9CYGzoy0sbJfr1IGkDfw1yq
 /DdBQ0tQzHfGbBlHD2ouVh3VZiYaxW/dn4Evc=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1708110355; x=1708715155;
 h=mime-version:message-id:in-reply-to:date:subject:cc:to:from
 :user-agent:references:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=WhaJXe2T3Wbb6tdsY5oB9gFTHOYpxXLCbPOjh1j270Y=;
 b=LxPPIa+vNjloAVVqgfKPaROqw0PImjH6DB/jEVPQ7nyBJw9oKkmJXEWYDg/f+HtXEA
 RB8492Bc+CeRUTRlVAWADrQ2KRLq7KGi5OKGNDEco2jLxnAHeUMpj1h/5pTu1/vBnw+a
 Bh6HRUUmhPRv5Fr+6IDBzZLUwxvJA0T8VYvgdHf1cBYaK3veStqOPGb9zwVcKPoJWV6n
 lbYHKpcnI4DWy1uZKrU4PinniBO6t9iHFTyqRYto7tFAVc5s9S+yfDAS4VoIFREeYe6t
 Jmz2nnjSOZruoYOGOSrolNezlE4ijOGeEHc81XDpIowPLKF9LQY4MyrKg+s6dkWZ4v2u
 nzEA==
X-Gm-Message-State: AOJu0YxcZV6mvCsPGSQxHJDQqUDQ5ckXiBBF7Op5/RCrq4d6/Yi9snP8
 W3VGacBBG6Zg3sKd2F2mFqWglRSmMZ45XouerxESRF5oEZjFjCPL13BbaWdy58A=
X-Google-Smtp-Source: AGHT+IEz9nlEi+9Ia3E8vDi5ibui6EY3uFf9db9ToHN5h3zkxNt2HCA59DR3OGU62Rxx3vQfAWq8WQ==
X-Received: by 2002:ac2:5a4a:0:b0:512:8717:127a with SMTP id
 r10-20020ac25a4a000000b005128717127amr3469634lfn.24.1708110355386; 
 Fri, 16 Feb 2024 11:05:55 -0800 (PST)
Received: from localhost ([2a02:2454:a09d:d000:3f1e:a87:ccd2:4aec])
 by smtp.gmail.com with ESMTPSA id
 c18-20020a50f612000000b00561fbfebdb5sm265584edn.96.2024.02.16.11.05.54
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 16 Feb 2024 11:05:55 -0800 (PST)
References: <d5f0813c-c156-c3d1-3e8b-b6a73b188ae9@HIDDEN>
 <736b3c27-c913-38b2-f89a-ccc5f486a665@HIDDEN>
User-agent: mu4e 1.10.8; emacs 29.1
From: Sergey Trofimov <sarg@HIDDEN>
To: paul <goodoldpaul@HIDDEN>
Subject: Re: [bug#68857] [PATCH] gnu: home: dotfiles: Avoid creating extra
 directory in $HOME.
Date: Fri, 16 Feb 2024 19:57:24 +0100
In-reply-to: <736b3c27-c913-38b2-f89a-ccc5f486a665@HIDDEN>
Message-ID: <87le7kmdpq.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain; format=flowed
X-Spam-Score: -1.9 (-)
X-Debbugs-Envelope-To: 68857
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, 68857 <at> debbugs.gnu.org,
 janneke@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.9 (--)


Hi Paul,

paul <goodoldpaul@HIDDEN> writes:

> Hi everyone,
>
> thank you for your help and comments so far. I have a proposal 
> that should:
>
> - solve https://issues.guix.gnu.org/68848
>
> - allow for both plain and GNU Stow's layouts
>
> - for GNU Stow layouts, allows to select a subset of application 
> dotfiles to be
>   provisioned in the user's home directory. Please Sergey let me 
>   know if this
>  covers your use case .
>


My dotfiles tree is (relative to ~/.dotfiles):
./guix/home.scm
./backup/.config/..
./android/.config/..
...

It works with such config:

--8<---------------cut here---------------start------------->8---
(service home-dotfiles-service-type
    (home-dotfiles-configuration
      (directories
        (list
          (home-dotfiles-stow-directory
            (name "..")
            (applications
            '("backup"
              "android"
              "email"
              "xsession"
              "git"
              "qutebrowser"
              "desktop")))))))
--8<---------------cut here---------------end--------------->8---

`name` is in fact a relative path, so this field should be 
renamed.
`applications` are called `PACKAGES` in `stow` man page, so I'd 
rename it to match.




Information forwarded to guix-patches@HIDDEN:
bug#68857; Package guix-patches. Full text available.

Message received at 68857 <at> debbugs.gnu.org:


Received: (at 68857) by debbugs.gnu.org; 16 Feb 2024 17:18:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 16 12:18:14 2024
Received: from localhost ([127.0.0.1]:60162 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rb1qn-0001oY-8B
	for submit <at> debbugs.gnu.org; Fri, 16 Feb 2024 12:18:14 -0500
Received: from confino.investici.org ([93.190.126.19]:28607)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <goodoldpaul@HIDDEN>) id 1rb1qk-0001oJ-Fk
 for 68857 <at> debbugs.gnu.org; Fri, 16 Feb 2024 12:18:11 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org;
 s=stigmate; t=1708103870;
 bh=KiRu0SH/JHFERLusnyhuKpHkly0uD3LO7KTuOx0iPQc=;
 h=From:To:Cc:Subject:Date:From;
 b=GjFk7X3ZIUhzI4GOIaq6yxLBu37PtzpqhsVWgG12Shjtjzq/gV/yI2vkbCtOe5aWQ
 7QDFaIT91zf3pJ9tqwzGhYdW0eyzW/7kxWSsSVjtq3dcpWUU2giEOmeLCP1DYV4eGb
 nVEfhlYEJzZwHIlqG8WZeAvvS+A2hffemm1lRE5A=
Received: from mx1.investici.org (unknown [127.0.0.1])
 by confino.investici.org (Postfix) with ESMTP id 4TbzCL3gfLz1146;
 Fri, 16 Feb 2024 17:17:50 +0000 (UTC)
Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19])
 (Authenticated sender: goodoldpaul@HIDDEN) by localhost (Postfix) with
 ESMTPSA id 4TbzCL2vf2z1144; Fri, 16 Feb 2024 17:17:50 +0000 (UTC)
From: Giacomo Leidi <goodoldpaul@HIDDEN>
To: 68857 <at> debbugs.gnu.org
Subject: [PATCH v2] gnu: home: dotfiles: Properly support both plain and Stow
 directory layouts.
Date: Fri, 16 Feb 2024 18:17:19 +0100
Message-ID: <20240216171724.22171-1-goodoldpaul@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.6 (--)
X-Debbugs-Envelope-To: 68857
Cc: Giacomo Leidi <goodoldpaul@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.6 (---)

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 creating a new record type for each directory layout. This
approach, compared to having a single field in
home-dotfiles-configuration,
allows for having different layouts for different directories and to
carry additional information that might be required for some layouts.

Implementing a new layout should just be a matter of creating a new
record type, defining a strip-*-dotfile procedure and plugging them into
the home-dotfiles-service-type.

* gnu/home/services/dotfiles (home-dotfiles-stow-directory): New
variable;
(home-dotfiles-plain-directory): new variable;
(home-dotfiles-configuration): migrate to (gnu services configuration);
(strip-stow-dotfile): new variable;
(strip-plain-dotfile): new variable;
(home-dotfiles-configuration->files): use the new record types;
[directory-contents]: allow for
selecting a subset of application dotfile directories;
* doc/guix.texi: document the new layouts.

Change-Id: I2e96037608353e360828290f055ec5271cfdfd48
---
 doc/guix.texi                  | 147 ++++++++++++++++++++++++++++-----
 gnu/home/services/dotfiles.scm | 143 ++++++++++++++++++++++++++------
 2 files changed, 244 insertions(+), 46 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 04119a5955..21adfb1fc0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -44368,17 +44368,39 @@ directory, and some way of automatically deploy changes to their user home.
 @cindex Stow-like dot file management
 The @code{home-dotfiles-service-type} from @code{(gnu home services dotfiles)}
 is designed to ease the way into using Guix Home for this kind of users,
-allowing them to point the service to their dotfiles directory, which must
-follow the layout suggested by
-@uref{https://www.gnu.org/software/stow/, GNU Stow},
-and have their dotfiles automatically deployed to their user home, without
+allowing them to point the service to their dotfiles directory without
 migrating them to Guix native configurations.
 
-The dotfiles directory layout is expected to be structured as follows. Please
-keep in mind that it is advisable to keep your dotfiles directories under
+Please keep in mind that it is advisable to keep your dotfiles directories under
 version control, for example in the same repository where you'd track your
 Guix Home configuration.
 
+There are two supported dotfiles directory layouts, for now. The
+@code{home-dotfiles-plain-directory} layout, which is structured as follows:
+
+@example
+~$ tree -a ./dotfiles/
+dotfiles/
+├── .gitconfig
+├── .gnupg
+│   ├── gpg-agent.conf
+│   └── gpg.conf
+├── .guile
+├── .config
+│   ├── guix
+│   │   └── channels.scm
+│   └── nixpkgs
+│       └── config.nix
+├── .nix-channels
+├── .tmux.conf
+└── .vimrc
+@end example
+
+and the @code{home-dotfiles-stow-directory} layout, which must
+follow the layout suggested by
+@uref{https://www.gnu.org/software/stow/, GNU Stow} and presents and additional
+application specific directory layer, just like:
+
 @example
 ~$ tree -a ./dotfiles/
 dotfiles/
@@ -44408,8 +44430,9 @@ dotfiles/
 @end example
 
 For an informal specification please refer to the Stow manual
-(@pxref{Top,,, stow, Introduction}). A suitable configuration would then
-be:
+(@pxref{Top,,, stow, Introduction}).
+
+A suitable configuration with a @emph{plain} layout could be:
 
 @lisp
 (home-environment
@@ -44417,7 +44440,10 @@ be:
   (services
     (service home-dotfiles-service-type
              (home-dotfiles-configuration
-               (directories (list "./dotfiles"))))))
+               (directories
+                 (list
+                   (home-dotfiles-plain-directory
+                     (name "./dotfiles"))))))))
 @end lisp
 
 The expected home directory state would then be:
@@ -44444,32 +44470,113 @@ Return a service which is very similiar to @code{home-files-service-type}
 (and actually extends it), but designed to ease the way into using Guix
 Home for users that already track their dotfiles under some kind of version
 control.  This service allows users to point Guix Home to their dotfiles
-directory and have their files automatically deployed to their home directory
-just like Stow would, without migrating all of their dotfiles to Guix native
+directory and have their files automatically provisioned to their home
+directory, without migrating all of their dotfiles to Guix native
 configurations.
 @end defvar
 
+@c %start of fragment
+
 @deftp {Data Type} home-dotfiles-configuration
 Available @code{home-dotfiles-configuration} fields are:
 
 @table @asis
-@item @code{source-directory} (default: @code{(current-source-directory)})
-The path where dotfile directories are resolved. By default dotfile directories
-are resolved relative the source location where
+@item @code{source-directory} (default: @code{(current-source-directory)}) (type: string)
+The path where dotfile directories are resolved.  By default dotfile
+directories are resolved relative the source location where
 @code{home-dotfiles-configuration} appears.
 
-@item @code{directories} (type: list-of-strings)
-The list of dotfiles directories where @code{home-dotfiles-service-type} will
-look for application dotfiles.
+@item @code{directories} (default: @code{'()}) (type: list-of-plain-or-stow-directories)
+The list of dotfiles directories where @code{home-dotfiles-service-type}
+will look for application dotfiles.  Each element of the list is supposed to be
+either a @code{home-dotfiles-plain-directory} or a
+@code{home-dotfiles-stow-directory} record.
+
+@item @code{excluded} (default: @code{'(".*~" ".*\\.swp" "\\.git" "\\.gitignore")}) (type: list-of-strings)
+The list of file patterns @code{home-dotfiles-service-type} will exclude
+while visiting each one of the @code{directories}.
+
+@end table
+
+@end deftp
+
+
+@c %end of fragment
+
+@c %start of fragment
+
+@deftp {Data Type} home-dotfiles-plain-directory
+
+This record represents the simplest layout supported.  In this layout the
+dotfiles directory contains a tree of files which will be directly mapped into
+the user directory:
+
+@example
+~$ tree -a ./dotfiles/
+dotfiles/
+├── .guile
+├── .config
+│   └── guix
+│       └── channels.scm
+├── .tmux.conf
+└── .vimrc
+@end example
+
+Available @code{home-dotfiles-plain-directory} fields are:
 
-@item @code{exclude} (default: @code{'(".*~" ".*\\.swp" "\\.git" "\\.gitignore")})
-The list of file patterns @code{home-dotfiles-service-type} will exclude while
-visiting each one of the @code{directories}.
+@table @asis
+@item @code{name} (type: string)
+The name of the dotfile directory where
+@code{home-dotfiles-service-type} will look for plain dotfiles.
 
 @end table
 
 @end deftp
 
+@c %start of fragment
+
+@deftp {Data Type} home-dotfiles-stow-directory
+
+This record represents GNU Stow's usual layout.  In this layout the
+dotfiles directory contains a layer of application directories, each one
+containing a home file tree.  The @code{home-dotfiles-service-type} will
+take care of provisioning dotfiles just like Stow would.
+
+@example
+~$ tree -a ./dotfiles/
+dotfiles/
+├── guile
+│   └── .guile
+├── guix
+│   └── .config
+│       └── guix
+│           └── channels.scm
+├── tmux
+│   └── .tmux.conf
+└── vim
+    └── .vimrc
+
+@end example
+
+Available @code{home-dotfiles-stow-directory} fields are:
+
+@table @asis
+@item @code{name} (type: string)
+The name of the dotfile directory where
+@code{home-dotfiles-service-type} will look for application dotfiles.
+
+@item @code{applications} (type: maybe-list-of-strings)
+A subset of the names of the application layer directories.  When
+provided the @code{home-dotfiles-service-type} will only provision
+dotfiles from this subset of applications.
+
+@end table
+
+@end deftp
+
+
+@c %end of fragment
+
 @defvar home-xdg-configuration-files-service-type
 The service is very similar to @code{home-files-service-type} (and
 actually extends it), but used for defining files, which will go to
diff --git a/gnu/home/services/dotfiles.scm b/gnu/home/services/dotfiles.scm
index 6a740c42ce..ebe9600585 100644
--- a/gnu/home/services/dotfiles.scm
+++ b/gnu/home/services/dotfiles.scm
@@ -20,16 +20,33 @@
 (define-module (gnu home services dotfiles)
   #:use-module (gnu home services)
   #:use-module (gnu services)
+  #:use-module (gnu services configuration)
   #:autoload   (guix build utils) (find-files)
+  #:use-module (guix diagnostics)
   #:use-module (guix gexp)
-  #:use-module (guix records)
+  #:use-module (guix i18n)
   #:use-module ((guix utils) #:select (current-source-directory))
   #:use-module (srfi srfi-1)
   #:use-module (ice-9 ftw)
+  #:use-module (ice-9 match)
   #:use-module (ice-9 regex)
   #:export (home-dotfiles-service-type
+            home-dotfiles-configuration->files
+
+            home-dotfiles-stow-directory
+            home-dotfiles-stow-directory?
+            home-dotfiles-stow-directory-fields
+            home-dotfiles-stow-directory-name
+            home-dotfiles-stow-directory-applications
+
+            home-dotfiles-plain-directory
+            home-dotfiles-plain-directory?
+            home-dotfiles-plain-directory-fields
+            home-dotfiles-plain-directory-name
+
             home-dotfiles-configuration
             home-dotfiles-configuration?
+            home-dotfiles-configuration-fields
             home-dotfiles-configuration-source-directory
             home-dotfiles-configuration-directories
             home-dotfiles-configuration-excluded))
@@ -40,26 +57,79 @@ (define %home-dotfiles-excluded
     "\\.git"
     "\\.gitignore"))
 
-(define-record-type* <home-dotfiles-configuration>
-  home-dotfiles-configuration make-home-dotfiles-configuration
-  home-dotfiles-configuration?
-  (source-directory  home-dotfiles-configuration-source-directory
-                     (default (current-source-directory))
-                     (innate))
-  (directories       home-dotfiles-configuration-directories       ;list of strings
-                     (default '()))
-  (excluded          home-dotfiles-configuration-excluded       ;list of strings
-                     (default %home-dotfiles-excluded)))
-
-(define (import-dotfiles directory files)
+(define list-of-strings?
+  (list-of string?))
+
+(define-maybe list-of-strings)
+
+(define-configuration/no-serialization home-dotfiles-stow-directory
+  (name
+   (string)
+   "The name of the dotfile directory where @code{home-dotfiles-service-type}
+will look for application dotfiles.")
+  (applications
+   (maybe-list-of-strings)
+   "A subset of the names of the application layer directories. When provided
+the @code{home-dotfiles-service-type} will only provision dotfiles from this
+subset of applications."))
+
+(define-configuration/no-serialization home-dotfiles-plain-directory
+  (name
+   (string)
+   "The name of the dotfile directory where @code{home-dotfiles-service-type}
+will look for plain dotfiles."))
+
+(define (list-of-plain-or-stow-directories? value)
+  (unless (list? value)
+    (raise
+     (formatted-message
+      (G_ "directories field of home-dotfiles-configuration should be a list but
+~a was found.")
+      value)))
+  (for-each
+   (lambda (d)
+     (unless (or (home-dotfiles-plain-directory? d)
+                 (home-dotfiles-stow-directory? d))
+       (raise
+        (formatted-message
+         (G_ "directories field of home-dotfiles-configuration should contain
+only home-dotfiles-plain-directory or home-dotfiles-stow-directory records, but
+~a was found.")
+         d))))
+   value))
+
+(define-configuration/no-serialization home-dotfiles-configuration
+  (source-directory
+   (string (current-source-directory))
+   "The path where dotfile directories are resolved.  By default dotfile
+directories are resolved relative the source location where
+@code{home-dotfiles-configuration} appears.")
+  (directories
+   (list-of-plain-or-stow-directories '())
+   "The list of dotfiles directories where @code{home-dotfiles-service-type}
+will look for application dotfiles.  Each element of the list is supposed to be
+either a @code{home-dotfiles-plain-directory} or a
+@code{home-dotfiles-stow-directory} record.")
+  (excluded
+   (list-of-strings %home-dotfiles-excluded)
+   "The list of file patterns @code{home-dotfiles-service-type} will exclude
+while visiting each one of the @code{directories}."))
+
+(define (strip-stow-dotfile file-name directory)
+  (let ((dotfile-name (string-drop file-name (1+ (string-length directory)))))
+    (match (string-split dotfile-name #\/)
+      ((package parts ...)
+       (string-join parts "/")))))
+
+(define (strip-plain-dotfile file-name directory)
+  (string-drop file-name (+ 1 (string-length directory))))
+
+(define (import-dotfiles directory files strip)
   "Return a list of objects compatible with @code{home-files-service-type}'s
 value.  Each object is a pair where the first element is the relative path
 of a file and the second is a gexp representing the file content.  Objects are
 generated by recursively visiting DIRECTORY and mapping its contents to the
 user's home directory, excluding files that match any of the patterns in EXCLUDED."
-  (define (strip file)
-    (string-drop file (+ 1 (string-length directory))))
-
   (define (format file)
     ;; Remove from FILE characters that cannot be used in the store.
     (string-append
@@ -73,7 +143,7 @@ (define (format file)
                  file)))
 
   (map (lambda (file)
-         (let ((stripped (strip file)))
+         (let ((stripped (strip file directory)))
            (list stripped
                  (local-file file (format stripped)
                              #:recursive? #t))))
@@ -88,11 +158,18 @@ (define excluded
   (define exclusion-rx
     (make-regexp (string-append "^.*(" (string-join excluded "|") ")$")))
 
-  (define (directory-contents directory)
-    (find-files directory
-                (lambda (file stat)
-                  (not (regexp-exec exclusion-rx
-                                    (basename file))))))
+  (define* (directory-contents directory #:key (applications #f))
+    (define (filter-files directory)
+      (find-files directory
+                  (lambda (file stat)
+                    (not (regexp-exec exclusion-rx
+                                      (basename file))))))
+    (if applications
+        (append-map filter-files
+                    (map (lambda (app)
+                           (string-append directory "/" app))
+                         applications))
+        (filter-files directory)))
 
   (define (resolve directory)
     ;; Resolve DIRECTORY relative to the 'source-directory' field of CONFIG.
@@ -101,10 +178,24 @@ (define (resolve directory)
         (in-vicinity (home-dotfiles-configuration-source-directory config)
                      directory)))
 
-  (append-map (lambda (directory)
-                (let* ((directory (resolve directory))
-                       (contents  (directory-contents directory)))
-                  (import-dotfiles directory contents)))
+  (append-map (lambda (record)
+                (let* ((name (if (home-dotfiles-plain-directory? record)
+                                 (home-dotfiles-plain-directory-name record)
+                                 (home-dotfiles-stow-directory-name record)))
+                       (strip (if (home-dotfiles-plain-directory? record)
+                                  strip-plain-dotfile
+                                  strip-stow-dotfile))
+                       (applications
+                        (and (home-dotfiles-stow-directory? record)
+                             (let ((apps
+                                    (home-dotfiles-stow-directory-applications
+                                     record)))
+                               (and (maybe-value-set? apps) apps))))
+                       (directory (resolve name))
+                       (contents
+                        (directory-contents directory
+                                            #:applications applications)))
+                  (import-dotfiles directory contents strip)))
               (home-dotfiles-configuration-directories config)))
 
 (define-public home-dotfiles-service-type

base-commit: bd87416648929f38c0173f047776d7675ea8a10d
-- 
2.41.0





Information forwarded to guix-patches@HIDDEN:
bug#68857; Package guix-patches. Full text available.

Message received at 68857 <at> debbugs.gnu.org:


Received: (at 68857) by debbugs.gnu.org; 16 Feb 2024 17:17:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Feb 16 12:17:04 2024
Received: from localhost ([127.0.0.1]:60158 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rb1pf-0001lJ-Oq
	for submit <at> debbugs.gnu.org; Fri, 16 Feb 2024 12:17:04 -0500
Received: from confino.investici.org ([93.190.126.19]:64529)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <goodoldpaul@HIDDEN>) id 1rb1pc-0001kl-E9
 for 68857 <at> debbugs.gnu.org; Fri, 16 Feb 2024 12:17:02 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org;
 s=stigmate; t=1708103792;
 bh=6VV2Ta90vW+PMygY81qkEvFcl6zth72D4Kb6RJxxqL4=;
 h=Date:Subject:From:To:Cc:References:In-Reply-To:From;
 b=cSKJMkat4vZAIGb1ctgMxV9Of2T2NjDX3WHZKCiR+o1it80O9zh0A8JXfwDeTnO+3
 Hd3H74DgTxsZffy6er7lXKU6Hc8+NOmLDooOwmhNlS2s0T3MOehw5ifViEijotsxF9
 RkqVqHND2AXultimyQN7rbJmm7x/WzeukrZKSJVs=
Received: from mx1.investici.org (unknown [127.0.0.1])
 by confino.investici.org (Postfix) with ESMTP id 4Tbz9r4HvGz1146;
 Fri, 16 Feb 2024 17:16:32 +0000 (UTC)
Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19])
 (Authenticated sender: goodoldpaul@HIDDEN) by localhost (Postfix) with
 ESMTPSA id 4Tbz9r2jLMz1144; Fri, 16 Feb 2024 17:16:32 +0000 (UTC)
Message-ID: <736b3c27-c913-38b2-f89a-ccc5f486a665@HIDDEN>
Date: Fri, 16 Feb 2024 18:16:31 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.15.0
Subject: Re: [bug#68857] [PATCH] gnu: home: dotfiles: Avoid creating extra
 directory in $HOME.
Content-Language: en-US
From: paul <goodoldpaul@HIDDEN>
To: 68857 <at> debbugs.gnu.org
References: <d5f0813c-c156-c3d1-3e8b-b6a73b188ae9@HIDDEN>
In-Reply-To: <d5f0813c-c156-c3d1-3e8b-b6a73b188ae9@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -5.9 (-----)
X-Debbugs-Envelope-To: 68857
Cc: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>,
 Sergey Trofimov <sarg@HIDDEN>, janneke@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -6.9 (------)

Hi everyone,

thank you for your help and comments so far. I have a proposal that should:

- solve https://issues.guix.gnu.org/68848

- allow for both plain and GNU Stow's layouts

- for GNU Stow layouts, allows to select a subset of application 
dotfiles to be provisioned in the user's home directory. Please Sergey 
let me know if this covers your use case .


Ludo' , Janneke, let me know your thoughts on this v2 and if it works 
for your directory layouts. Thank you again everyone for your efforts.


giacomo





Information forwarded to guix-patches@HIDDEN:
bug#68857; Package guix-patches. Full text available.

Message received at 68857 <at> debbugs.gnu.org:


Received: (at 68857) by debbugs.gnu.org; 7 Feb 2024 08:38:02 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 07 03:38:01 2024
Received: from localhost ([127.0.0.1]:55674 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rXdRR-0000mG-HW
	for submit <at> debbugs.gnu.org; Wed, 07 Feb 2024 03:38:01 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:37156)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <janneke@HIDDEN>) id 1rXdRP-0000m3-2d
 for 68857 <at> debbugs.gnu.org; Wed, 07 Feb 2024 03:38:00 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <janneke@HIDDEN>)
 id 1rXdR1-0000yk-Bi; Wed, 07 Feb 2024 03:37:35 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=LAAye3SNbO4kEK4Yq2UXL6i427GCFVL3Fk6ormnIl5g=; b=na9I70sq1b1Z2dQT1psf
 4DuoLKrIZYgjzlfOvtxgvA3kjPQMzIjHEwnaqPzernn6HXLy0MocmnJAzMdit3g2ntQjC3MmclFYJ
 irZehXzQdyelGCoAKDjKQF9kRwJSVqZt0BaT2sfu3FKk5uAaK7iLOr2eakGk1R3xTj90cCZGRBtbw
 VOkvKmw6QAy6+/3jXxnXdt4AWkPN1C+SzoWtdj26oT8jfMHZP+CcYP9JP5t1r+T+jYs65ShwrsYQ2
 elTOXOTz8vMC8bv8YesbtOR/wTMWC9VzSUJUUYgcycXeH1cDLU5XKP0Su3H/t9XVcpMjRf0KFNmUc
 VaOg0eVSLjElGA==;
From: Janneke Nieuwenhuizen <janneke@HIDDEN>
To: paul <goodoldpaul@HIDDEN>
Subject: Re: [bug#68857] [PATCH] gnu: home: dotfiles: Avoid creating extra
 directory in $HOME.
In-Reply-To: <87cyt8d7hu.fsf@HIDDEN> (Janneke Nieuwenhuizen's message of
 "Wed, 07 Feb 2024 09:05:33 +0100")
Organization: AvatarAcademy.nl
References: <d5f0813c-c156-c3d1-3e8b-b6a73b188ae9@HIDDEN>
 <87cyt8d7hu.fsf@HIDDEN>
X-Url: http://AvatarAcademy.nl
Date: Wed, 07 Feb 2024 09:37:30 +0100
Message-ID: <878r3wd60l.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68857
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
 Sergey Trofimov <sarg@HIDDEN>, 68857 <at> debbugs.gnu.org, andrew@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Janneke Nieuwenhuizen writes:

> paul writes:
>
> Hi Paul,
>
>> could you try whether this patch solves
>> https://issues.guix.gnu.org/68848 for you?
>
> Yes, that fixes it.  Although I would rather write it something like
>
> (define (strip file-name)
>   (let ((dotfile-name (string-drop file-name (+1 (string-length directory=
)))))

Err that should have been 1+, of course, so

--8<---------------cut here---------------start------------->8---
(define (strip file-name)
  (let ((dotfile-name (string-drop file-name (1+ (string-length directory))=
)))
    (match (string-split dotfile-name #\/)
      ((package parts ...)
       (string-join parts "/")))))
--8<---------------cut here---------------end--------------->8---

--=20
Janneke Nieuwenhuizen <janneke@HIDDEN>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar=C2=AE https://AvatarAcade=
my.com




Information forwarded to guix-patches@HIDDEN:
bug#68857; Package guix-patches. Full text available.

Message received at 68857 <at> debbugs.gnu.org:


Received: (at 68857) by debbugs.gnu.org; 7 Feb 2024 08:06:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 07 03:06:07 2024
Received: from localhost ([127.0.0.1]:55646 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rXcwY-0008B1-St
	for submit <at> debbugs.gnu.org; Wed, 07 Feb 2024 03:06:07 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:51722)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <janneke@HIDDEN>) id 1rXcwV-0008AM-V7
 for 68857 <at> debbugs.gnu.org; Wed, 07 Feb 2024 03:06:04 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <janneke@HIDDEN>)
 id 1rXcw8-0003dk-Um; Wed, 07 Feb 2024 03:05:40 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To:
 From; bh=QsojFwBrXY9rNcmZSSYY1fbJ90/7EHeBr5vQxjw9vQA=; b=cl8yVYT6pOO6knibsd9G
 FxTDS7G7Lruv9uzUD5EX+r5gCwrCaNEI9tR3mpQOboj0xbkGNBdBm8ezrpvqprCBvaRD5vFtwk8tq
 Pjwk/rzgDXD+LwRsyZjzmjzNBlFrwdSOuTZp6VLiavBoj0AyrQMRNsxLjOJIsVAJM4jN7O93jrWlb
 eztAQCB/G/DeSz9oCq3ide7SrorT948bl0W+P8XX04BhzOdQIYl69zoQfB5vX+0kSSQIRQvLx4Hdl
 ewOtLA1FzgX005uv1PwCeiHeSXgatWjvAc1chp9Ymab5hasCJFFwH+KW9fFK7up0O7aYNhhOuS4eg
 JDYCKgQJZI2jSg==;
From: Janneke Nieuwenhuizen <janneke@HIDDEN>
To: paul <goodoldpaul@HIDDEN>
Subject: Re: [bug#68857] [PATCH] gnu: home: dotfiles: Avoid creating extra
 directory in $HOME.
In-Reply-To: <d5f0813c-c156-c3d1-3e8b-b6a73b188ae9@HIDDEN> (paul's
 message of "Wed, 7 Feb 2024 01:54:27 +0100")
Organization: AvatarAcademy.nl
References: <d5f0813c-c156-c3d1-3e8b-b6a73b188ae9@HIDDEN>
X-Url: http://AvatarAcademy.nl
Date: Wed, 07 Feb 2024 09:05:33 +0100
Message-ID: <87cyt8d7hu.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 68857
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>,
 Sergey Trofimov <sarg@HIDDEN>, 68857 <at> debbugs.gnu.org, andrew@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

paul writes:

Hi Paul,

> could you try whether this patch solves
> https://issues.guix.gnu.org/68848 for you?

Yes, that fixes it.  Although I would rather write it something like

--8<---------------cut here---------------start------------->8---
(define (strip file-name)
  (let ((dotfile-name (string-drop file-name (+1 (string-length directory))=
)))
    (match (string-split dotfile-name #\/)
      ((package parts ...)
       (string-join parts "/")))))
--8<---------------cut here---------------end--------------->8---

> Thank you for your time,

No problem, somehow I looked for a patch and didn't see it before.

Thanks for the ping and for fixing this.

Greetings,
Janneke

--=20
Janneke Nieuwenhuizen <janneke@HIDDEN>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar=C2=AE https://AvatarAcade=
my.com




Information forwarded to guix-patches@HIDDEN:
bug#68857; Package guix-patches. Full text available.

Message received at 68857 <at> debbugs.gnu.org:


Received: (at 68857) by debbugs.gnu.org; 7 Feb 2024 00:54:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 06 19:54:43 2024
Received: from localhost ([127.0.0.1]:55409 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rXWD5-0004XQ-3M
	for submit <at> debbugs.gnu.org; Tue, 06 Feb 2024 19:54:43 -0500
Received: from confino.investici.org ([93.190.126.19]:20039)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <goodoldpaul@HIDDEN>) id 1rXWD3-0004XH-K9
 for 68857 <at> debbugs.gnu.org; Tue, 06 Feb 2024 19:54:42 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org;
 s=stigmate; t=1707267267;
 bh=+3haXULhqxPgxHbBNi4GdvawkF6Q3ELdXTYLPI+DPAs=;
 h=Date:To:Cc:From:Subject:From;
 b=i4J7jwQnvvD/wW7sMIY+efd9aWLR/kELLT3eveq6xEbZ+4ZXtnLZjJJw70aNpLkMV
 a/noQCksdeg/1lBMKM14WeUrKTpid7vKQcnsB2bqrSL9Q3daqAJtSs7xQClKLTCjHO
 y1InK8L173e7L1BXsbPgj9j0IQa8jLqfFN6Lt1U8=
Received: from mx1.investici.org (unknown [127.0.0.1])
 by confino.investici.org (Postfix) with ESMTP id 4TV1pq4DDmz113f;
 Wed,  7 Feb 2024 00:54:27 +0000 (UTC)
Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19])
 (Authenticated sender: goodoldpaul@HIDDEN) by localhost (Postfix) with
 ESMTPSA id 4TV1pq28kxz113X; Wed,  7 Feb 2024 00:54:27 +0000 (UTC)
Message-ID: <d5f0813c-c156-c3d1-3e8b-b6a73b188ae9@HIDDEN>
Date: Wed, 7 Feb 2024 01:54:27 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.15.0
Content-Language: en-US
To: 68857 <at> debbugs.gnu.org
From: paul <goodoldpaul@HIDDEN>
Subject: Re: [bug#68857] [PATCH] gnu: home: dotfiles: Avoid creating extra
 directory in $HOME.
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 68857
Cc: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>,
 Sergey Trofimov <sarg@HIDDEN>, andrew@HIDDEN, janneke@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Hi Janneke,

could you try whether this patch solves 
https://issues.guix.gnu.org/68848 for you?

Thank you for your time,

giacomo





Information forwarded to guix-patches@HIDDEN:
bug#68857; Package guix-patches. Full text available.

Message received at 68857 <at> debbugs.gnu.org:


Received: (at 68857) by debbugs.gnu.org; 31 Jan 2024 22:18:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 31 17:18:08 2024
Received: from localhost ([127.0.0.1]:39184 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rVIuF-000662-LP
	for submit <at> debbugs.gnu.org; Wed, 31 Jan 2024 17:18:07 -0500
Received: from confino.investici.org ([2a11:7980:1::2:0]:46797)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <goodoldpaul@HIDDEN>) id 1rVIuD-00065r-4Y
 for 68857 <at> debbugs.gnu.org; Wed, 31 Jan 2024 17:18:06 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org;
 s=stigmate; t=1706739474;
 bh=JlNHK2Cz5KbFRmoeeQOQEAfmo1lD6jTu8GQlpz6MB/8=;
 h=From:To:Cc:Subject:Date:From;
 b=RztKwwDaFwszuzW6QUAlmzSZ9+6cGceeBgBQmv+8jla+jiTCm2YNg+Tb8tS0TYMf3
 hhr6UpKeRh/Es2gL2J9BDQPuZegr77rLJqwO9tg1ASlgkS8gEHT1HRWGgwnwq0+R/7
 0V3ab8lnlCiyUya+fhZ+qz4FBRM5PM1JhnT1GgdM=
Received: from mx1.investici.org (unknown [127.0.0.1])
 by confino.investici.org (Postfix) with ESMTP id 4TQGcy5bKhz11Ft;
 Wed, 31 Jan 2024 22:17:54 +0000 (UTC)
Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19])
 (Authenticated sender: goodoldpaul@HIDDEN) by localhost (Postfix) with
 ESMTPSA id 4TQGcy4qj6z11Fn; Wed, 31 Jan 2024 22:17:54 +0000 (UTC)
From: Giacomo Leidi <goodoldpaul@HIDDEN>
To: 68857 <at> debbugs.gnu.org
Subject: [PATCH] gnu: home: dotfiles: Avoid creating extra directory in $HOME.
Date: Wed, 31 Jan 2024 23:17:48 +0100
Message-ID: <20240131221748.1190-1-goodoldpaul@HIDDEN>
X-Mailer: git-send-email 2.41.0
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 68857
Cc: Giacomo Leidi <goodoldpaul@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

This patch applies the fix from https://issues.guix.gnu.org/60521#43 ,
it is supposed to fix https://issues.guix.gnu.org/68848 .

* gnu/home/services/dotfiles.scm (import-dotfiles)[strip]: Drop extra
directory.

Change-Id: I98b747396e1fc8a8925204cde2bb705019ce2c1d
---
 gnu/home/services/dotfiles.scm | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gnu/home/services/dotfiles.scm b/gnu/home/services/dotfiles.scm
index 6a740c42ce..fc842f1fb3 100644
--- a/gnu/home/services/dotfiles.scm
+++ b/gnu/home/services/dotfiles.scm
@@ -58,7 +58,11 @@ (define (import-dotfiles directory files)
 generated by recursively visiting DIRECTORY and mapping its contents to the
 user's home directory, excluding files that match any of the patterns in EXCLUDED."
   (define (strip file)
-    (string-drop file (+ 1 (string-length directory))))
+    (string-join
+     (cdr
+      (string-split (string-drop file (+ 1 (string-length directory)))
+                    #\/))
+     "/"))
 
   (define (format file)
     ;; Remove from FILE characters that cannot be used in the store.

base-commit: bf7991a8c767abd32cfb2c92e3d57665a7cabf00
-- 
2.41.0





Information forwarded to guix-patches@HIDDEN:
bug#68857; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 31 Jan 2024 22:16:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Jan 31 17:16:17 2024
Received: from localhost ([127.0.0.1]:39178 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rVIsT-00062U-4n
	for submit <at> debbugs.gnu.org; Wed, 31 Jan 2024 17:16:17 -0500
Received: from lists.gnu.org ([2001:470:142::17]:60984)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <goodoldpaul@HIDDEN>) id 1rVIsS-000621-3r
 for submit <at> debbugs.gnu.org; Wed, 31 Jan 2024 17:16:16 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <goodoldpaul@HIDDEN>)
 id 1rVIsA-0005Az-RM
 for guix-patches@HIDDEN; Wed, 31 Jan 2024 17:16:00 -0500
Received: from confino.investici.org ([2a11:7980:1::2:0])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <goodoldpaul@HIDDEN>)
 id 1rVIs7-0005Vw-5S; Wed, 31 Jan 2024 17:15:57 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=autistici.org;
 s=stigmate; t=1706739348;
 bh=zFfglOkMLREtr0sCM+HqZDGfyA3/QF3t538LNtqqNeU=;
 h=Date:To:Cc:From:Subject:From;
 b=KGO9Ny4avpaFgl5cI2MOE5q+QEhtKhNGr681rDdU2fSV7yK2LsQUwOA8zmt7TGUMN
 9xAYCR/O6iZ8+G0VBV38gCSabM+d3nODajr163cU45trk3SuDT6F8onaqq6szS73KB
 B0olKdQwdbrot3TSv7kV7omLosI1SKol5QnOWSIo=
Received: from mx1.investici.org (unknown [127.0.0.1])
 by confino.investici.org (Postfix) with ESMTP id 4TQGZX4Klqz11JF;
 Wed, 31 Jan 2024 22:15:48 +0000 (UTC)
Received: from [93.190.126.19] (mx1.investici.org [93.190.126.19])
 (Authenticated sender: goodoldpaul@HIDDEN) by localhost (Postfix) with
 ESMTPSA id 4TQGZX2yyBz11J7; Wed, 31 Jan 2024 22:15:48 +0000 (UTC)
Message-ID: <14bc720d-7fdc-516a-3018-58294c1cafcd@HIDDEN>
Date: Wed, 31 Jan 2024 23:15:47 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.15.0
Content-Language: en-US
To: guix-patches@HIDDEN
From: paul <goodoldpaul@HIDDEN>
Subject: gnu: home: dotfiles: Avoid creating extra directory in $HOME.
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=2a11:7980:1::2:0;
 envelope-from=goodoldpaul@HIDDEN; helo=confino.investici.org
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.9 (/)
X-Debbugs-Envelope-To: submit
Cc: =?UTF-8?Q?Ludovic_Court=c3=a8s?= <ludo@HIDDEN>,
 Sergey Trofimov <sarg@HIDDEN>, 68848 <at> debbugs.gnu.org, janneke@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.1 (/)

Hello,

I'm sending a patch supposed to fix https://issues.guix.gnu.org/68848  . 
Please let me know if this is ok for you and fixes your issues.


Thank you,


giacomo





Acknowledgement sent to paul <goodoldpaul@HIDDEN>:
New bug report received and forwarded. Copy sent to guix-patches@HIDDEN. Full text available.
Report forwarded to guix-patches@HIDDEN:
bug#68857; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 27 Feb 2024 10:30:02 UTC

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