Good filesystem for the nix store

I am wondering what a good choice of filesystem for the nix store would be.
The nix store seems to me to have a somewhat special write pattern (data is never overwritten).
I guess nilfs2 (https://en.wikipedia.org/wiki/NILFS) might be a good choice.

Possibly (I don’t have experience/knowledge). I’ve been using btrfs typically, which also uses non-overwriting approach (by default), and it seems relatively common among nixers (and generally more popular than nilfs, I think). But even plain ext4 is quite fine, I believe… at least unless you want some of the extra features that ext4 doesn’t have.

2 Likes

I garbage collect the store somewhat irregularly, so transparent compression support in ZFS and btrfs is really nice (I don’t know if NILFS supports transparent compression). The compression ratio of the root volume on my current machine:

% zfs get compressratio /
NAME              PROPERTY       VALUE  SOURCE
zpool/root/nixos  compressratio  1.88x  -
1 Like

But even plain ext4 is quite fine, I believe… at least unless you want some of the extra features that ext4 doesn’t have.

Key missing feature: dynamic allocation of extra inodes…

(Nix store can get symlink-heavy with some use patterns, so it is possible to run out of inodes without being even close to running out of space)

4 Likes