lambdabot: add configuration
This commit is contained in:
parent
82f22dd5a1
commit
91f3912b5d
@ -11,6 +11,7 @@
|
|||||||
++ referencePlugins
|
++ referencePlugins
|
||||||
++ socialPlugins
|
++ socialPlugins
|
||||||
''
|
''
|
||||||
|
, configuration ? "[]"
|
||||||
}:
|
}:
|
||||||
|
|
||||||
# FIXME: fix hoogle search
|
# FIXME: fix hoogle search
|
||||||
@ -29,6 +30,7 @@ let allPkgs = pkgs: mueval.defaultPkgs pkgs ++ [ pkgs.lambdabot-trusted ] ++ pac
|
|||||||
++ lib.optional (aspell != null) aspell
|
++ lib.optional (aspell != null) aspell
|
||||||
);
|
);
|
||||||
modulesStr = lib.replaceChars ["\n"] [" "] ("corePlugins ++ " + modules);
|
modulesStr = lib.replaceChars ["\n"] [" "] ("corePlugins ++ " + modules);
|
||||||
|
configStr = lib.replaceChars ["\n"] [" "] configuration;
|
||||||
|
|
||||||
in lib.overrideDerivation haskellngPackages.lambdabot (self: {
|
in lib.overrideDerivation haskellngPackages.lambdabot (self: {
|
||||||
postPatch = (self.postPatch or "") + ''
|
postPatch = (self.postPatch or "") + ''
|
||||||
@ -36,6 +38,9 @@ in lib.overrideDerivation haskellngPackages.lambdabot (self: {
|
|||||||
# not via sed to avoid escaping issues
|
# not via sed to avoid escaping issues
|
||||||
substituteInPlace src/Modules.hs \
|
substituteInPlace src/Modules.hs \
|
||||||
--replace '@modules@' '${modulesStr}'
|
--replace '@modules@' '${modulesStr}'
|
||||||
|
sed -i 's/\[dataDir :=> dir\]/@config@ ++ \0/' src/Main.hs
|
||||||
|
substituteInPlace src/Main.hs \
|
||||||
|
--replace '@config@' '${configStr}'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
buildInputs = self.buildInputs ++ [ makeWrapper ];
|
buildInputs = self.buildInputs ++ [ makeWrapper ];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user