Setting up snapraid-btrfs on nixos

Hi,

I’m getting started with nixos and so far loving it, tutorials have been the best way for me to move things along.

My objective is to setup a NAS with home assistant and jellyfin on the side.

For data I’m using 4 drives:

  • 1 1TB drive
  • 1 2TB drive
  • 2 4TB drive
    All spinning disks

For the RAID configuration, it seems like the best option for my case (because of how uneven my drives are and how I plan to expand (one drive at a time)) is snapraid.

It looks like snapraid can be “easily” accessible as it’s already packaged for nixos, however, I know snapraid comes with it’s one risk: data changing between syncs.

After reading some more I found out about snapraid-btrfs, but I haven’t found much about it running on nixos (apart from this post talking about it a bit).

With all that said, does anyone here have any pointers on where to start with this ordeal? Any tutorials, config examples or blogposts are welcome.

BTW I’m running nixos 23.11 with home-manager.

Thanks

1 Like

Hey @ory_the_human,

the author of the post you linked has his config on github, dotfiles/nixos at d2f77892d237dff90bbbf458bb3f255b982013d9 · kasuboski/dotfiles · GitHub :

Hi @damianfral,

Yes, I’ve been using that config as a reference now, I just had to learn about nixos/flakes first and things seem to be moving along now, I hope to get that over the line this weekend.

Thank you.

Heyo @ory_the_human! will you dare to share any of your findings? I’m finding myself in a very similar position. Still quite the nixos n00b running away from truenas scale / ZFS to setup something more fitting for heterogeneous spinners. thx!

Hi @tuky,

I’m still working through it, I’ve managed to do a sync and a cleanup if I run it by hand (sudo snapraid-btrfs sync) but the runner I’m still struggling with.

I plan on doing a write up of the whole process (TBH I find it weird that no one has done it before) but I don’t think I’ll get to it before the weekend.

In the meantime, I managed to get things running by following this guide and the config files from this post

1 Like

A quick update on this:

After a lot of debugging (and learning a lot about journalctl) I was able to execute the runner correctly, due to my file structure/the things I have planned for my homelab I have to execute the runner as root.

@tuky I’ll push my configs to github tonight and post them here for you to explore before I do my writeup

1 Like