1 { lib, haskellLib, makeWrapper, haskellPackages
5 , packages ? (pkgs: [])
6 , modules ? "oldDefaultModules"
10 let allPkgs = pkgs: mueval.defaultPkgs pkgs ++ [ pkgs.lambdabot-trusted ] ++ packages pkgs;
11 mueval' = mueval.override {
12 inherit haskellPackages;
15 bins = lib.makeBinPath ([ mueval'
16 (haskellPackages.ghcWithHoogle allPkgs)
17 haskellPackages.unlambda
18 haskellPackages.brainfuck
20 ++ lib.optional withDjinn haskellPackages.djinn
21 ++ lib.optional (aspell != null) aspell
23 modulesStr = lib.replaceStrings ["\n"] [" "] modules;
24 configStr = lib.replaceStrings ["\n"] [" "] configuration;
26 in haskellLib.overrideCabal (self: {
27 patches = (self.patches or []) ++ [ ./custom-config.patch ];
28 postPatch = (self.postPatch or "") + ''
29 substituteInPlace src/Main.hs \
30 --replace '@config@' '${configStr}'
31 substituteInPlace src/Modules.hs \
32 --replace '@modules@' '${modulesStr}'
35 buildTools = (self.buildTools or []) ++ [ makeWrapper ];
37 postInstall = (self.postInstall or "") + ''
38 wrapProgram $out/bin/lambdabot \
39 --prefix PATH ":" '${bins}'
41 }) haskellPackages.lambdabot