Swift, XCTest and Exercism

Hello, NixOS community. I have started a Swift track on Exercism (this is a platform for practicing programming languages) and am trying to set up a development environment on my Linux (non NixOS) system. After carefully reading all the information I was able to find, I came up with the next Flake for my dev shell:

{
    inputs = {
        nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
        utils.url = "github:numtide/flake-utils";
    };

    outputs = {self, nixpkgs, utils}:
    let out = system:
    let pkgs = nixpkgs.legacyPackages."${system}";
    in {

        devShell = pkgs.mkShell.override { inherit (pkgs.swift) stdenv; } {
            buildInputs = with pkgs; [
              swift
              swiftPackages.swiftpm
              swiftPackages.Foundation
              swiftPackages.XCTest
            ];
            LD_LIBRARY_PATH = "${pkgs.swiftPackages.Dispatch}/lib";
        };

    }; in with utils.lib; eachSystem defaultSystems out;

}

But when I try to run swift test for hello-world exercise, I get the next error:

❯ swift test
Building for debugging...
error: open("/nix/store/9cyp7l2dxjk06gmbhfgv573bmrns47y3-swift-5.8-lib/lib/libIndexStore.so: cannot open shared object file: No such file or directory")
[0/6] Wrapping AST for HelloWorldTests for debugging
error: fatalError

Unfortunately I have no prior experience with Swift. So I do not understand what it trying to do with libIndexStore.so and where should I look for it.

I would be very grateful if someone could point me to the right direction or maybe give complete solution for the problem.

Addition:

swift build completes successfully:

❯ swift build
Building for debugging...
[4/4] Compiling HelloWorld HelloWorld.swift
Build complete! (0.39s)

Preconfigured dev environments…might help