lol
1# Create a derivation that contains aspell and selected dictionaries.
2# Composition is done using `pkgs.buildEnv`.
3# Beware of that `ASPELL_CONF` used by this derivation is not always
4# respected by libaspell (#28815) and in some cases, when used as
5# dependency by another derivation, the passed dictionaries will be
6# missing. However, invoking aspell directly should be fine.
7
8{ aspell
9, aspellDicts
10, makeWrapper
11, buildEnv
12}:
13
14f:
15
16let
17 # Dictionaries we want
18 dicts = f aspellDicts;
19
20in buildEnv {
21 name = "aspell-env";
22 nativeBuildInputs = [ makeWrapper ];
23 paths = [ aspell ] ++ dicts;
24 postBuild = ''
25 # Construct wrappers in /bin
26 unlink "$out/bin"
27 mkdir -p "$out/bin"
28 pushd "${aspell}/bin"
29 for prg in *; do
30 if [ -f "$prg" ]; then
31 makeWrapper "${aspell}/bin/$prg" "$out/bin/$prg" --set ASPELL_CONF "dict-dir $out/lib/aspell"
32 fi
33 done
34 popd
35 '';
36}