Cabal init fails in devShell

Trying to set up a Haskell developer environment with the following flake:

{
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11-small";

  outputs = { self, nixpkgs }: {

    devShell."x86_64-linux" =
      with import nixpkgs { system = "x86_64-linux"; };
      pkgs.mkShell {
        buildInputs = [
          haskellPackages.ghc
          haskellPackages.cabal-install
          haskellPackages.cabal2nix
        ];
      };

  };
}

Get into dev shell by nix develop and run cabal update but when I run cabal init it fails with the following error:

fd:15: hGetContents: invalid argument (invalid byte sequence)

Somebody having an idea what the reason for this can be?

Versions:
nix 2.4
Ubuntu 20.04.2 LTS
1 Like

Is solved by setting LOCALE_ARCHIVE: NixOS - Nixpkgs 21.11 manual

1 Like