nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 22.05 41 lines 1.4 kB view raw
1{ lib, haskellLib, makeWrapper, haskellPackages 2, mueval 3, withDjinn ? true 4, aspell ? null 5, packages ? (pkgs: []) 6, modules ? "oldDefaultModules" 7, configuration ? "[]" 8}: 9 10let allPkgs = pkgs: mueval.defaultPkgs pkgs ++ [ pkgs.lambdabot-trusted ] ++ packages pkgs; 11 mueval' = mueval.override { 12 inherit haskellPackages; 13 packages = allPkgs; 14 }; 15 bins = lib.makeBinPath ([ mueval' 16 (haskellPackages.ghcWithHoogle allPkgs) 17 haskellPackages.unlambda 18 haskellPackages.brainfuck 19 ] 20 ++ lib.optional withDjinn haskellPackages.djinn 21 ++ lib.optional (aspell != null) aspell 22 ); 23 modulesStr = lib.replaceChars ["\n"] [" "] modules; 24 configStr = lib.replaceChars ["\n"] [" "] configuration; 25 26in 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}' 33 ''; 34 35 buildTools = (self.buildTools or []) ++ [ makeWrapper ]; 36 37 postInstall = (self.postInstall or "") + '' 38 wrapProgram $out/bin/lambdabot \ 39 --prefix PATH ":" '${bins}' 40 ''; 41}) haskellPackages.lambdabot