Hunspell cant find dicts on flake

I need help with hunspell, im trying to set its dict to pt_PT but whenever i try to use hunspell -D it cant find any dicts.

{
  description = "Development environment";

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

  outputs =
    {
      nixpkgs,
      flake-utils,
      ...
    }:
    flake-utils.lib.eachDefaultSystem (
      system:
      let
        pkgs = nixpkgs.legacyPackages.${system};
      in
      {
        devShells.default = pkgs.mkShell {
          buildInputs = [
            pkgs.hunspell
          ];
          env.DICPATH = pkgs.lib.makeLibraryPath (
            with pkgs.hunspellDicts;
            [
              pt_PT
              en_US
            ]
          );
        };
      }
    );
}

What am i missing?

using

            (pkgs.hunspellWithDicts (with pkgs.hunspellDicts; [ pt_PT ]))

works

1 Like