From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id mN0cHUq03mSJywAASxT56A (envelope-from ) for ; Fri, 18 Aug 2023 01:59:06 +0200 Received: from aspmx1.migadu.com ([2001:41d0:306:2d92::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id YBEIHUq03mSs1QAA9RJhRA (envelope-from ) for ; Fri, 18 Aug 2023 01:59:06 +0200 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 8D001307AD for ; Fri, 18 Aug 2023 01:59:05 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-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=1692316746; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=hmoTJMkGOxetK4XFVL+FH7HozxzmUotgRkEJ2iWVKWc=; b=GFYzNkGp0VlW15Yoszg5tjElrPvKIr0PQZrdjxBLJc6rNqICFxQr9vJBTi+FD2sIRCG0ua WxQ0qI8GVmglgic+YDo5XG2g/GAjJX9F2qMBrtivo878221vfSNp6LK0x6yrBq9GK3MJ+T +yRQa4nVQuBj7vbjRlI5QDgS5XlDUCR0AOsYTOvYTpFHW6m0RLyA575wqnFJyeeOECJxEF Ikt1DsaMsxqmvTk6x3XrhhPHosDUv4fgdZAfjN4SRxsDe7Y9pNpiTGOfkqkH1bk7n+J4IC ypZAK4QI7560Cco0PyCAiJBw4ewV+Ud3IwNL4wHzzclZgKt78YTZq/+OKOtUsA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1692316746; a=rsa-sha256; cv=none; b=oQhvvVXLmTXGlEVxmFUQiNtiDuoSBqpaTjSnfesUncH0bjWZXfiiATlS79kbFHf75pEr6p E2+iTBEprR4c883d0fWjXp+Rqh3ThWQGxKVZHU0ntedKhvfGWiRzhd6MyR5QkTlzSF2wE/ 7yumUq9LI796jaJoGYxI++BVNLyvf0hkMTXWF1krreS4wDCWJ3qfHgDdtp9zcG7rAQv3y+ vJERzmWD71qHWi/Wi+Gym66gk9uRMwpJPedgh1l9t9ry8m30N0BwQITAHFEmE1ZT++Gevp l8oXJKKhfS9gfggQQdoRc0WRwEn/w2Qv3X/yzmQlzpd53donBlnQW+jS/Xe53g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qWmsm-0007NV-2z; Thu, 17 Aug 2023 19:58:28 -0400 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 1qWmsh-0007NL-Rd for guix-devel@gnu.org; Thu, 17 Aug 2023 19:58:24 -0400 Received: from 5.mo550.mail-out.ovh.net ([178.33.45.107]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qWmse-0007MA-Gt for guix-devel@gnu.org; Thu, 17 Aug 2023 19:58:23 -0400 Received: from director11.ghost.mail-out.ovh.net (unknown [10.109.156.62]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id DA5A524121 for ; Thu, 17 Aug 2023 23:58:15 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-tdvw8 (unknown [10.110.103.34]) by director11.ghost.mail-out.ovh.net (Postfix) with ESMTPS id AA9141FD83; Thu, 17 Aug 2023 23:58:08 +0000 (UTC) Received: from ngraves.fr ([37.59.142.108]) by ghost-submission-6684bf9d7b-tdvw8 with ESMTPSA id TIvaJRC03mQywgoAfWP0Ng (envelope-from ); Thu, 17 Aug 2023 23:58:08 +0000 X-OVh-ClientIp: 81.67.140.142 To: guix-devel@gnu.org Cc: efraim@flashner.co.il, maxim.cournoyer@gmail.com, Felix Lechner , Ryan Sundberg , Andrew Tropin Subject: Re: btrfs recommended layout for snapshots? In-Reply-To: <87o7j776ha.fsf@ngraves.fr> References: <87jztxn2hc.fsf@ngraves.fr> <87h6p1n0sv.fsf@ngraves.fr> <87o7j776ha.fsf@ngraves.fr> Date: Fri, 18 Aug 2023 01:58:08 +0200 Message-ID: <87y1i95ii7.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 12976840854726369883 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedviedrudduvddgvdejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtsehttdertddttddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhephedugffhheffgfffjeekgedvleetgfegiedvgeejheevudeljeekffdtvdelgfeknecuffhomhgrihhnpehnihigohhsrdifihhkihenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepghhuihigqdguvghvvghlsehgnhhurdhorhhgpdfovfetjfhoshhtpehmohehhedtpdhmohguvgepshhmthhpohhuth Received-SPF: pass client-ip=178.33.45.107; envelope-from=ngraves@ngraves.fr; helo=5.mo550.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves From: Nicolas Graves via "Development of GNU Guix and the GNU System distribution." Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: guix-devel-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.19 X-Migadu-Scanner: mx2.migadu.com X-Migadu-Queue-Id: 8D001307AD X-Spam-Score: -4.19 X-TUID: UHvocy8chSXR On 2023-08-16 10:10, Nicolas Graves wrote: > I guess it's possible to do the same with my home as well (thus only > saving actual data and not consecutive linking metadata), but that might > require some more time and fine-grained applications considerations. > > One weakness from this impermanence feature is that it's actually > application-dependent. For guix-system it's not very damaging (except if > we want very low-level optimizations, like setting nodatacow on > subvolumes with databases etc), but for guix-home, it makes things much > more difficult. @Andrew Tropin : maybe that's something we could in RDE in > a state-btrfs in (gnu home-services state) if we find a way to migrate > directories to subvolumes safely and reproducibly. Some notes about more progress I've done. My attempt to also load the /home subvolume on tmfps has quite progressed. I've created the following subvolumes : ;; App related (apps who doesn't entirely follow the XDG base directory ;; specification and save data or cache outside of XDG_DATA_HOME, ;; XDG_STATE_HOME and XDG_CACHE_HOME. Other users may need other app dirs. /home/graves/.config/chromium /home/graves/.config/emacs /home/graves/.config/libreoffice /home/graves/.config/guix /home/graves/.ssh ;; XDG_CACHE_HOME, XDG_STATE_HOME, XDG_DATA_HOME (I'm using RDE) /home/graves/.cache /home/graves/.local ;; And some personal want-to-save directories. /home/graves/archives /home/graves/resources /home/graves/projects /home/graves/spheres The only thing that seems to get in my way to achieve this properly is... .guix-home! Which I don't want to backup since it's only a link and that would require at least /home/graves/ to be snapshotted. I thus have a proposition for discussion : Make .guix-home XDG base dir compliant by storing a symlink in $XDG_CONFIG_DIR/guix/home to /var/guix/per-user/$user/guix-home instead of the current default of the symlink in /home/$user/.guix-home to the actual object in the store. This was discussed in a previous mail thread : "RFC: Configurable placing of the ~/.guix-home symlink" With Andrew concluding that > Back in the day, the implementation of Guix Home required a symlink in > home directory, right now due to improvements in symlink-manager and > reconfigure code it's probably not necessary and with a few patches > /var/guix/profiles/per-user/bob/guix-home/ can be used instead. With a first glance, I think it's possible to do in the code, since the home-run-on-first-login-service-type already gets the UID of the user, and with the following guile function : Scheme Procedure: passwd:name pw The name of the userid. we should be able to get the name of the user and replace ~/.guix-home with /var/guix/per-user/$user/guix-home everywhere. So the code where a hardlink is needed will be, and the "pleasing UX of searching within guix home" would also be possible. I also don't really see the reason why .guix-home shouldn't be $XDG_CONFIG_DIR/guix/home since it's really user-specific and unique (and XDG user dirs are too), unlike .guix-profile. This may be the one of the only missing step to make the (manual and only with directories (btrfs subvolumes), at least for now) implementation of impermanence (a quick reminder of the idea implemented by nix here : https://nixos.wiki/wiki/Impermanence) on with guix home, I would appreciate some feedback comments on the idea ;) (another step would be to actually activate the home environment on login in home-shell-profile-service-type, but migrating .guix-home would be a requirement). -- Best regards, Nicolas Graves