mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 05:33:23 +00:00
36 lines
678 B
Nix
36 lines
678 B
Nix
# Create a derivation that contains aspell and selected dictionaries.
|
|
# Composition is done using `pkgs.buildEnv`.
|
|
|
|
{ aspell
|
|
, aspellDicts
|
|
, makeWrapper
|
|
, symlinkJoin
|
|
, runCommand
|
|
}:
|
|
|
|
f:
|
|
|
|
let
|
|
# Dictionaries we want
|
|
dicts = f aspellDicts;
|
|
|
|
# A tree containing the dictionaries
|
|
dictEnv = symlinkJoin {
|
|
name = "aspell-dicts";
|
|
paths = dicts;
|
|
};
|
|
|
|
in runCommand "aspell-env" {
|
|
buildInputs = [ makeWrapper ];
|
|
} ''
|
|
# Construct wrappers in /bin
|
|
mkdir -p $out/bin
|
|
pushd "${aspell}/bin"
|
|
for prg in *; do
|
|
if [ -f "$prg" ]; then
|
|
makeWrapper "${aspell}/bin/$prg" "$out/bin/$prg" --set ASPELL_CONF "dict-dir ${dictEnv}/lib/aspell"
|
|
fi
|
|
done
|
|
popd
|
|
''
|