diff --git a/pkgs/applications/networking/misc/zammad/default.nix b/pkgs/applications/networking/misc/zammad/default.nix index 8060f582851e..e267bb52dcdc 100644 --- a/pkgs/applications/networking/misc/zammad/default.nix +++ b/pkgs/applications/networking/misc/zammad/default.nix @@ -1,6 +1,7 @@ { stdenv , lib , fetchFromGitHub +, applyPatches , bundlerEnv , defaultGemConfig , callPackage @@ -20,7 +21,18 @@ let pname = "zammad"; version = "5.0.2"; - sourceDir = fetchFromGitHub (builtins.fromJSON (builtins.readFile ./source.json)); + sourceDir = applyPatches "zammad-patched" { + + src = fetchFromGitHub (builtins.fromJSON (builtins.readFile ./source.json)); + + patches = [ ./0001-nulldb.patch ]; + + postPatch = '' + sed -i -e "s|ruby '2.7.4'|ruby '${ruby_2_7.version}'|" Gemfile + sed -i -e "s|ruby 2.7.4p191|ruby ${ruby_2_7.version}|" Gemfile.lock + sed -i -e "s|2.7.4|${ruby_2_7.version}|" .ruby-version + ''; + }; databaseConfig = writeText "database.yml" '' production: @@ -87,10 +99,6 @@ in stdenv.mkDerivation { src = sourceDir; - patches = [ - ./0001-nulldb.patch - ]; - buildInputs = [ rubyEnv rubyEnv.wrappedRuby