nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

lambdabot: rework custom modules and configuration

+69 -27
+49
pkgs/development/tools/haskell/lambdabot/custom-config.patch
··· 1 + diff --git a/src/Main.hs b/src/Main.hs 2 + index 61da2f3..39e5c9b 100644 3 + --- a/src/Main.hs 4 + +++ b/src/Main.hs 5 + @@ -73,11 +73,14 @@ main = do 6 + config' <- sequence config 7 + dir <- P.getDataDir 8 + exitWith <=< lambdabotMain modulesInfo $ 9 + - [dataDir ==> dir, lbVersion ==> P.version] ++ config' 10 + + [dataDir ==> dir, lbVersion ==> P.version] ++ configInfo ++ config' 11 + 12 + -- special online target for ghci use 13 + online :: [String] -> IO () 14 + online strs = do 15 + dir <- P.getDataDir 16 + - void $ lambdabotMain modulesInfo 17 + - [dataDir ==> dir, lbVersion ==> P.version, onStartupCmds ==> strs] 18 + + void $ lambdabotMain modulesInfo $ 19 + + [dataDir ==> dir, lbVersion ==> P.version, onStartupCmds ==> strs] ++ configInfo 20 + + 21 + +configInfo :: [DSum Config Identity] 22 + +configInfo = @config@ 23 + diff --git a/src/Modules.hs b/src/Modules.hs 24 + index 036ea1f..eaafa50 100644 25 + --- a/src/Modules.hs 26 + +++ b/src/Modules.hs 27 + @@ -14,10 +14,15 @@ import Lambdabot.Plugin.Reference 28 + import Lambdabot.Plugin.Social 29 + 30 + modulesInfo :: Modules 31 + -modulesInfo = $(modules $ corePlugins 32 + - ++ haskellPlugins 33 + - ++ ["irc", "localtime", "topic"] -- ircPlugins 34 + - ++ ["dummy", "fresh", "todo"] -- miscPlugins 35 + - ++ ["bf", "dice", "elite", "filter", "quote", "slap", "unlambda", "vixen"] -- noveltyPlugins 36 + - ++ referencePlugins 37 + - ++ socialPlugins) 38 + +modulesInfo = 39 + + $(modules $ 40 + + let oldDefaultModules = 41 + + corePlugins 42 + + ++ haskellPlugins 43 + + ++ ["irc", "localtime", "topic"] -- ircPlugins 44 + + ++ ["dummy", "fresh", "todo"] -- miscPlugins 45 + + ++ ["bf", "dice", "elite", "filter", "quote", "slap", "unlambda", "vixen"] -- noveltyPlugins 46 + + ++ referencePlugins 47 + + ++ socialPlugins 48 + + in @modules@ 49 + + )
+14 -23
pkgs/development/tools/haskell/lambdabot/default.nix
··· 1 - { lib, makeWrapper, haskellngPackages 1 + { lib, haskell-lib, fetchpatch, makeWrapper, haskellPackages 2 2 , mueval 3 3 , withDjinn ? true 4 4 , aspell ? null 5 5 , packages ? (pkgs: []) 6 - , modules ? '' 7 - haskellPlugins 8 - ++ ["irc", "localtime", "topic"] 9 - ++ ["dummy", "fresh", "todo"] 10 - ++ ["bf", "dice", "elite", "filter", "quote", "slap", "unlambda", "vixen"] 11 - ++ referencePlugins 12 - ++ socialPlugins 13 - '' 6 + , modules ? "oldDefaultModules" 14 7 , configuration ? "[]" 15 8 }: 16 9 ··· 11 18 12 19 let allPkgs = pkgs: mueval.defaultPkgs pkgs ++ [ pkgs.lambdabot-trusted ] ++ packages pkgs; 13 20 mueval' = mueval.override { 14 - inherit haskellngPackages; 21 + inherit haskellPackages; 15 22 packages = allPkgs; 16 23 }; 17 24 bins = lib.makeSearchPath "bin" ([ mueval' 18 - (haskellngPackages.ghcWithPackages allPkgs) 19 - haskellngPackages.unlambda 20 - haskellngPackages.brainfuck 25 + (haskellPackages.ghcWithPackages allPkgs) 26 + haskellPackages.unlambda 27 + haskellPackages.brainfuck 21 28 ] 22 - ++ lib.optional withDjinn haskellngPackages.djinn 29 + ++ lib.optional withDjinn haskellPackages.djinn 23 30 ++ lib.optional (aspell != null) aspell 24 31 ); 25 - modulesStr = lib.replaceChars ["\n"] [" "] ("corePlugins ++ " + modules); 32 + modulesStr = lib.replaceChars ["\n"] [" "] modules; 26 33 configStr = lib.replaceChars ["\n"] [" "] configuration; 27 34 28 - in lib.overrideDerivation haskellngPackages.lambdabot (self: { 35 + in haskell-lib.overrideCabal haskellPackages.lambdabot (self: { 36 + patches = (self.patches or []) ++ [ ./custom-config.patch ]; 29 37 postPatch = (self.postPatch or "") + '' 30 - sed -i 's/\(\$(modules \$ \).*/\1@modules@)/; /@modules@/q' src/Modules.hs 31 - # not via sed to avoid escaping issues 32 - substituteInPlace src/Modules.hs \ 33 - --replace '@modules@' '${modulesStr}' 34 - sed -i 's/\[dataDir :=> dir\]/@config@ ++ \0/' src/Main.hs 35 38 substituteInPlace src/Main.hs \ 36 39 --replace '@config@' '${configStr}' 40 + substituteInPlace src/Modules.hs \ 41 + --replace '@modules@' '${modulesStr}' 37 42 ''; 38 43 39 - buildInputs = self.buildInputs ++ [ makeWrapper ]; 44 + buildTools = (self.buildTools or []) ++ [ makeWrapper ]; 40 45 41 - postInstall = (self.postInstall or "") + lib.optionalString (bins != "") '' 46 + postInstall = (self.postInstall or "") + '' 42 47 wrapProgram $out/bin/lambdabot \ 43 48 --prefix PATH ":" '${bins}' 44 49 '';
+3 -3
pkgs/development/tools/haskell/mueval/default.nix
··· 1 - { stdenv, makeWrapper, haskellngPackages, packages ? (pkgs: []) 1 + { stdenv, makeWrapper, haskellPackages, packages ? (pkgs: []) 2 2 }: 3 3 4 4 let defaultPkgs = pkgs: [ pkgs.show ··· 6 6 pkgs.QuickCheck 7 7 pkgs.mtl 8 8 ]; 9 - env = haskellngPackages.ghcWithPackages 9 + env = haskellPackages.ghcWithPackages 10 10 (pkgs: defaultPkgs pkgs ++ packages pkgs); 11 11 libDir = "${env}/lib/ghc-${env.version}"; 12 12 13 13 in stdenv.mkDerivation { 14 14 name = "mueval-env"; 15 15 16 - inherit (haskellngPackages) mueval; 16 + inherit (haskellPackages) mueval; 17 17 18 18 nativeBuildInputs = [ makeWrapper ]; 19 19
+3 -1
pkgs/top-level/all-packages.nix
··· 8064 8064 8065 8065 readosm = callPackage ../development/libraries/readosm { }; 8066 8066 8067 - lambdabot = callPackage ../development/tools/haskell/lambdabot { }; 8067 + lambdabot = callPackage ../development/tools/haskell/lambdabot { 8068 + haskell-lib = haskell.lib; 8069 + }; 8068 8070 8069 8071 leksah = callPackage ../development/tools/haskell/leksah { 8070 8072 inherit (haskellPackages) ghcWithPackages;