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

  • btrfs recommended... Development of GNU Guix and the GNU System distribution.
    • Re: btrfs re... Development of GNU Guix and the GNU System distribution.
      • Re: btrf... Efraim Flashner
      • Re: btrf... Development of GNU Guix and the GNU System distribution.
        • Re: ... Development of GNU Guix and the GNU System distribution.
        • Re: ... Efraim Flashner
        • Re: ... Development of GNU Guix and the GNU System distribution.
          • ... Andrew Tropin
    • Re: btrfs re... Development of GNU Guix and the GNU System distribution.

Reply via email to