Error: undefined variable 'splitString' using SnapRAID on NixOS

I have been successfully using SnapRaid on NixOS for a long time, but today I encountered the following error when attempting a rebuild immediately after updating my flake inputs:

       error: undefined variable 'splitString'

       at /nix/store/cjz8w4dgc3rd2n3dqv5c208vygndjyba-source/nixos/modules/services/backup/snapraid.nix:225:44:

          224|                 # https://www.snapraid.it/manual#7.1
          225|                 splitParityFiles = map (s: splitString "," s) parityFiles;
             |                                            ^
          226|               in

Here is the relevant part of my config (unaltered from what previously worked):

  services.snapraid = {
    enable = true;
    parityFiles = [ "/srv/diskp/snapraid.parity" ];
    contentFiles = [
      "/var/snapraid/snapraid.content"
      "/mnt/disks/disk0/snapraid.content"
      "/mnt/disks/disk1/snapraid.content"
    ];
    dataDisks = {
      d0 = "/mnt/disks/disk0";
      d1 = "/mnt/disks/disk1";
    };
  };

Encountering this error after updating the flake inputs makes me think this is a bug in a new version of SnapRAID? It’s also worth noting that I use unstable nixpkgs.

Any help or advice is much appreciated. Thanks in advance!

That’s a Nix evaluation error, meaning it’s a problem in the nix expressions, not the snapraid package. Looks like someone tried to remove with lib; from the NixOS module in nixpkgs and did it wrong for this module. A fix has been merged, it’s just not on nixos-unstable yet. Should make it to unstable in a day or two.

1 Like

Oh ok perfect, thank you so much for the quick response!