mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 07:53:19 +00:00
lambdabot: add package
This commit is contained in:
parent
73bd3fbc7f
commit
4947f918ad
47
pkgs/development/tools/lambdabot/default.nix
Normal file
47
pkgs/development/tools/lambdabot/default.nix
Normal file
@ -0,0 +1,47 @@
|
||||
{ lib, makeWrapper, haskellngPackages
|
||||
, mueval
|
||||
, withDjinn ? true
|
||||
, aspell ? null
|
||||
, packages ? (pkgs: [])
|
||||
, modules ? ''
|
||||
haskellPlugins
|
||||
++ ["irc", "localtime", "topic"]
|
||||
++ ["dummy", "fresh", "todo"]
|
||||
++ ["bf", "dice", "elite", "filter", "quote", "slap", "unlambda", "vixen"]
|
||||
++ referencePlugins
|
||||
++ socialPlugins
|
||||
''
|
||||
}:
|
||||
|
||||
# FIXME: fix hoogle search
|
||||
|
||||
let allPkgs = pkgs: mueval.defaultPkgs pkgs ++ [ pkgs.lambdabot-trusted ] ++ packages pkgs;
|
||||
mueval' = mueval.override {
|
||||
inherit haskellngPackages;
|
||||
packages = allPkgs;
|
||||
};
|
||||
bins = lib.makeSearchPath "bin" ([ mueval'
|
||||
(haskellngPackages.ghcWithPackages allPkgs)
|
||||
haskellngPackages.unlambda
|
||||
haskellngPackages.brainfuck
|
||||
]
|
||||
++ lib.optional withDjinn haskellngPackages.djinn
|
||||
++ lib.optional (aspell != null) aspell
|
||||
);
|
||||
modulesStr = lib.replaceChars ["\n"] [" "] ("corePlugins ++ " + modules);
|
||||
|
||||
in lib.overrideDerivation haskellngPackages.lambdabot (self: {
|
||||
postPatch = (self.postPatch or "") + ''
|
||||
sed -i 's/\(\$(modules \$ \).*/\1@modules@)/; /@modules@/q' src/Modules.hs
|
||||
# not via sed to avoid escaping issues
|
||||
substituteInPlace src/Modules.hs \
|
||||
--replace '@modules@' '${modulesStr}'
|
||||
'';
|
||||
|
||||
buildInputs = self.buildInputs ++ [ makeWrapper ];
|
||||
|
||||
postInstall = (self.postInstall or "") + lib.optionalString (bins != "") ''
|
||||
wrapProgram $out/bin/lambdabot \
|
||||
--prefix PATH ":" '${bins}'
|
||||
'';
|
||||
})
|
@ -7415,6 +7415,8 @@ let
|
||||
|
||||
readosm = callPackage ../development/libraries/readosm { };
|
||||
|
||||
lambdabot = callPackage ../development/tools/lambdabot { };
|
||||
|
||||
leksah = callPackage ../development/tools/leksah {
|
||||
inherit (haskellngPackages) ghcWithPackages;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user