diff options
author | Nikolay Amiantov <ab@fmap.me> | 2015-09-08 17:17:09 +0300 |
---|---|---|
committer | Nikolay Amiantov <ab@fmap.me> | 2015-09-08 17:50:55 +0300 |
commit | 57c33c1c54dba43c52b0e2d488dd4a77b3a896e2 (patch) | |
tree | 8eb7f4d030879fccbffeda4c5b576046a5e29cf3 /pkgs/development/tools/haskell/lambdabot/default.nix | |
parent | c904dfa87c08916f838480241f874c59d44a2eb8 (diff) | |
download | nixpkgs-57c33c1c54dba43c52b0e2d488dd4a77b3a896e2.tar nixpkgs-57c33c1c54dba43c52b0e2d488dd4a77b3a896e2.tar.gz nixpkgs-57c33c1c54dba43c52b0e2d488dd4a77b3a896e2.tar.bz2 nixpkgs-57c33c1c54dba43c52b0e2d488dd4a77b3a896e2.tar.lz nixpkgs-57c33c1c54dba43c52b0e2d488dd4a77b3a896e2.tar.xz nixpkgs-57c33c1c54dba43c52b0e2d488dd4a77b3a896e2.tar.zst nixpkgs-57c33c1c54dba43c52b0e2d488dd4a77b3a896e2.zip |
lambdabot: rework custom modules and configuration
Diffstat (limited to 'pkgs/development/tools/haskell/lambdabot/default.nix')
-rw-r--r-- | pkgs/development/tools/haskell/lambdabot/default.nix | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/pkgs/development/tools/haskell/lambdabot/default.nix b/pkgs/development/tools/haskell/lambdabot/default.nix index f2462ed54e1..01dfe339d14 100644 --- a/pkgs/development/tools/haskell/lambdabot/default.nix +++ b/pkgs/development/tools/haskell/lambdabot/default.nix @@ -1,16 +1,9 @@ -{ lib, makeWrapper, haskellngPackages +{ lib, haskell-lib, fetchpatch, makeWrapper, haskellPackages , 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 -'' +, modules ? "oldDefaultModules" , configuration ? "[]" }: @@ -18,34 +11,32 @@ let allPkgs = pkgs: mueval.defaultPkgs pkgs ++ [ pkgs.lambdabot-trusted ] ++ packages pkgs; mueval' = mueval.override { - inherit haskellngPackages; + inherit haskellPackages; packages = allPkgs; }; bins = lib.makeSearchPath "bin" ([ mueval' - (haskellngPackages.ghcWithPackages allPkgs) - haskellngPackages.unlambda - haskellngPackages.brainfuck + (haskellPackages.ghcWithPackages allPkgs) + haskellPackages.unlambda + haskellPackages.brainfuck ] - ++ lib.optional withDjinn haskellngPackages.djinn + ++ lib.optional withDjinn haskellPackages.djinn ++ lib.optional (aspell != null) aspell ); - modulesStr = lib.replaceChars ["\n"] [" "] ("corePlugins ++ " + modules); + modulesStr = lib.replaceChars ["\n"] [" "] modules; configStr = lib.replaceChars ["\n"] [" "] configuration; -in lib.overrideDerivation haskellngPackages.lambdabot (self: { +in haskell-lib.overrideCabal haskellPackages.lambdabot (self: { + patches = (self.patches or []) ++ [ ./custom-config.patch ]; 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}' - sed -i 's/\[dataDir :=> dir\]/@config@ ++ \0/' src/Main.hs substituteInPlace src/Main.hs \ --replace '@config@' '${configStr}' + substituteInPlace src/Modules.hs \ + --replace '@modules@' '${modulesStr}' ''; - buildInputs = self.buildInputs ++ [ makeWrapper ]; + buildTools = (self.buildTools or []) ++ [ makeWrapper ]; - postInstall = (self.postInstall or "") + lib.optionalString (bins != "") '' + postInstall = (self.postInstall or "") + '' wrapProgram $out/bin/lambdabot \ --prefix PATH ":" '${bins}' ''; |