Alright, time for me to quit thinking about this and actually do it now. Having said that, I want any and all reasonable advice from anyone who's done anything like this before, so by all means—especially if you've tried doing something like this and went wrong at some point, because I would really like to know what not to do.

I'm about to set up an external ssd—one of those orange LaCie drives that's borderline indestructible and also connects over USB C, so also pretty fast, for USB at least—for my home directory as well as some other things related to that.

Already on NixOS, so Home Manager is already there, so continue using it, obviously. Also planning on making a new user that is separate from my current one, and also keeping the current one as-is, just it case; new one will use systemd-homed unless I happen to run into some reason why that's doesn't work, which I doubt, but I should also assume that's a non-zero chance until after I've already done all of this; assuming that works, which it should AFAIK, I want LUKs encryption, and out of the three available options (for systemd-homed, which are ext4, btrfs, and XFS), I want either btrfs or XFS if only to try something new (haven't used either of them before, already using ext4), and I'll consider any reasonable argument one way or the other in terms of which is better and why. Current idea is that splitting the drive into two partitions and symlinking between them is probably the best move; I suspect I'll find out soon enough. I also want Git and nothing else, as opposed to whatever fancy dotfiles manager; I'll make the few symlinks I'll actually need myself.

Thoughts?

#NixOS #Systemd #Git #HomeDirectory #Dotfiles

@the Whenever possible I avoid symlinks in favour of mounts. Bind mounts if necessary.

For file systems I enjoy zfs on my Proxmox nodes with the features that brings, but inside the virtual disks it's all xfs as I just need speed. btrfs has a similar featureset, so you should review if you need those features.

xfs is, very incorrectly, roughly a slimmed down ext4. It is fast, simple, and basically just has the drawback that xfs volumes don't have a shrink/reduce option.

@AngryAnt

Alright, I took your advice about mounts (you'll see why), and abandoned the idea of systemd-homed, mostly because I ended up reading that it tends to explode on NixOS—especially if you use home manager, which I technically already do and also plan to. Also, I decided that since zfs isn't even an option for systemd-homed, I have an excuse to try it now. I think that about the only thing I might find irritating is that in order to get my existing overlay for the kernel to work with zfs, without allowing broken packages globally (or migraines), I had to pin specific versions for the kernel and for zfs, and so I will have to update those manually at some point. Oh well. I think I'd rather sacrifice adding yet another systemd thing for my home directory, to be able to have zfs and home manager both working, honestly.

@the Ah interesting. I've only ever tried zfs on the Proxmox host. Good to know that (juggling aside) it is reasonably possible on NixOS :)

On my end I am finally starting the slow move of VMs to use Disko. I specifically wanted to be able to do fully-live testing via local VMs before doing a full deploy of configs to a proper testing VM on infrastructure.

Fully nix-declarative storage ofc. helps parameterise between different disk layouts presenting the same mounts.

@AngryAnt

Nice (I've never heard of Disko, tbh, but your use case makes it sound interesting).

Did I do everything right here? I haven't really started using it yet and not for anything important, so if I did something that's gonna bite me later, I can still just do it over again and lose nothing:

sudo wipefs -a /dev/disk/by-id/REDACTED-0:0

sudo sgdisk --zap-all /dev/disk/by-id/REDACTED-0:0

sudo zpool create -o ashift=12 -O compression=zstd -O atime=off -O normalization=formD -O mountpoint=/mnt/johndoe johndoe /dev/disk/by-id/REDACTED-0:0

sudo zfs create johndoe/home

sudo zfs create -o mountpoint=/home/johndoe johndoe/home/johndoe

@the At first glance that does look right to me.