about summary refs log tree commit diff
path: root/pkgs/development/tools
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2015-04-20 16:10:35 +0300
committerNikolay Amiantov <ab@fmap.me>2015-04-20 18:56:43 +0300
commit91f3912b5d4fb1f5631de8b67d439b1838df7e4f (patch)
tree2ea333fec7c979be97765108704478ce1a58d7b1 /pkgs/development/tools
parent82f22dd5a115bb3add0e948d2d335afdcfd25cd9 (diff)
downloadnixlib-91f3912b5d4fb1f5631de8b67d439b1838df7e4f.tar
nixlib-91f3912b5d4fb1f5631de8b67d439b1838df7e4f.tar.gz
nixlib-91f3912b5d4fb1f5631de8b67d439b1838df7e4f.tar.bz2
nixlib-91f3912b5d4fb1f5631de8b67d439b1838df7e4f.tar.lz
nixlib-91f3912b5d4fb1f5631de8b67d439b1838df7e4f.tar.xz
nixlib-91f3912b5d4fb1f5631de8b67d439b1838df7e4f.tar.zst
nixlib-91f3912b5d4fb1f5631de8b67d439b1838df7e4f.zip
lambdabot: add configuration
Diffstat (limited to 'pkgs/development/tools')
-rw-r--r--pkgs/development/tools/haskell/lambdabot/default.nix5
1 files changed, 5 insertions, 0 deletions
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 ];