From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 6Jt/M/Vy1GWdlQAAqHPOHw:P1 (envelope-from ) for ; Tue, 20 Feb 2024 10:37:58 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 6Jt/M/Vy1GWdlQAAqHPOHw (envelope-from ) for ; Tue, 20 Feb 2024 10:37:58 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=g7DzkYzf; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708421877; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=iaJYdtEiNKGhq+DapAK2FuwKvVkiCGvgCQm126fx4S4=; b=FNqhtdgq1em9kimkOqmsbUXy2qJqtXoTzBuHzvgJBu5yugjERCqMP4ZWH24ZT6JmLwLzrB kLTudU8Z3PNzz5Wtdxe1kOT46ONcdZydkj3+qkSgTzO3lVV9eQXjXVLb36tk7OuqXxXofy s101nuqfXr/fyd5tAGhTR5F2009voMFh5qso+dhaoic/FKWXUFVbzWdv1zy6Fi0tlxIGTq ouRxj0lR0ePr6WNaSYdHZ5FQqddbQoRYp17iQZHUhifl9p3rq0y7kDyYDWnPVmZKmTHKeu lZaroTk3J+dPIhxoB7IsNLquOps/XVsVyrAhuA68WWg5Vm5THraCn3kVaWAqmA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=g7DzkYzf; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708421877; a=rsa-sha256; cv=none; b=rV8TZwNJGtUjUxiE1sFvEnGQIuU1IquMBSE0SGLwcvGrJB1XQT1ZIZ/+jHs3/cazAn4b5T j6LgAVZoO7QPYOvcNKosN1GKihTsvz6usKsN08Cq70bNzX+W3crSyPpiFZYL93ITT1Iu5i NSbsLmQ3UUT2HxriRTwVLZJ+k9UXH7VvGxMNmbjSdMNgbQF8nURa7yEQEMmjc7GIHTbyRu y0TJhLXzjxWwPo2BREa2Cp5vyVkLoiLzYAMw6nDyezlS9ybPlhWbpwVOj2UM+dX8VCPGBs WfcWjZfjRdRpZtLyqxBPAXpafhMSmlRrrSRzN0Ols+bZ63V9bhoJemXyYt8QLQ== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id B23C3220A9 for ; Tue, 20 Feb 2024 10:37:57 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rcMZL-00088K-M8; Tue, 20 Feb 2024 04:37:43 -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 ) id 1rcMZJ-00087l-Az for guix-patches@gnu.org; Tue, 20 Feb 2024 04:37:41 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rcMZJ-0007cm-37 for guix-patches@gnu.org; Tue, 20 Feb 2024 04:37:41 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rcMZe-00039C-Ac for guix-patches@gnu.org; Tue, 20 Feb 2024 04:38:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68857] gnu: home: dotfiles: Avoid creating extra directory in $HOME. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 20 Feb 2024 09:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68857 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: Giacomo Leidi Cc: 68857@debbugs.gnu.org Received: via spool by 68857-submit@debbugs.gnu.org id=B68857.170842186412069 (code B ref 68857); Tue, 20 Feb 2024 09:38:02 +0000 Received: (at 68857) by debbugs.gnu.org; 20 Feb 2024 09:37:44 +0000 Received: from localhost ([127.0.0.1]:44290 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rcMZL-00038a-Bh for submit@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 ) id 1rcMZI-00038I-Bl for 68857@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 ) 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= In-Reply-To: <20240216171724.22171-1-goodoldpaul@autistici.org> (Giacomo Leidi's message of "Fri, 16 Feb 2024 18:17:19 +0100") References: <14bc720d-7fdc-516a-3018-58294c1cafcd@autistici.org> <20240216171724.22171-1-goodoldpaul@autistici.org> Date: Tue, 20 Feb 2024 10:37:08 +0100 Message-ID: <87msrvmq7v.fsf_-_@gnu.org> 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -6.38 X-Spam-Score: -6.38 X-Migadu-Queue-Id: B23C3220A9 X-TUID: KVTBxWcrPeLg Hello Giacomo! Giacomo Leidi 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 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 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 ,= as discussed earlier? Thanks, Ludo=E2=80=99.