From 91f3912b5d4fb1f5631de8b67d439b1838df7e4f Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Mon, 20 Apr 2015 16:10:35 +0300 Subject: [PATCH] lambdabot: add configuration --- pkgs/development/tools/haskell/lambdabot/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/development/tools/haskell/lambdabot/default.nix b/pkgs/development/tools/haskell/lambdabot/default.nix index e6e3eff99f3a..f2462ed54e17 100644 --- a/pkgs/development/tools/haskell/lambdabot/default.nix +++ b/pkgs/development/tools/haskell/lambdabot/default.nix @@ -11,6 +11,7 @@ ++ referencePlugins ++ socialPlugins '' +, configuration ? "[]" }: # FIXME: fix hoogle search @@ -29,6 +30,7 @@ let allPkgs = pkgs: mueval.defaultPkgs pkgs ++ [ pkgs.lambdabot-trusted ] ++ pac ++ lib.optional (aspell != null) aspell ); modulesStr = lib.replaceChars ["\n"] [" "] ("corePlugins ++ " + modules); + configStr = lib.replaceChars ["\n"] [" "] configuration; in lib.overrideDerivation haskellngPackages.lambdabot (self: { postPatch = (self.postPatch or "") + '' @@ -36,6 +38,9 @@ in lib.overrideDerivation haskellngPackages.lambdabot (self: { # 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}' ''; buildInputs = self.buildInputs ++ [ makeWrapper ];