20 dataDir ? "/var/lib/zammad",
28 src = fetchFromGitHub (lib.importJSON ./source.json);
30 ./fix-sendmail-location.diff
34 sed -i -e "s|ruby '3.2.[0-9]\+'|ruby '${ruby.version}'|" Gemfile
35 sed -i -e "s|ruby 3.2.[0-9]\+p[0-9]\+|ruby ${ruby.version}|" Gemfile.lock
36 sed -i -e "s|3.2.[0-9]\+|${ruby.version}|" .ruby-version
37 ${jq}/bin/jq '. += {name: "Zammad", version: "${version}"}' package.json | ${moreutils}/bin/sponge package.json
41 rubyEnv = bundlerEnv {
42 name = "${pname}-gems-${version}";
45 # Which ruby version to select:
46 # https://docs.zammad.org/en/latest/prerequisites/software.html#ruby-programming-language
50 gemset = ./gemset.nix;
60 gemConfig = defaultGemConfig // {
62 buildFlags = [ "--with-pg-config=${lib.getDev postgresql}/bin/pg_config" ];
69 buildFlags = [ "--without-imlib2-config" ];
73 "--with-v8-dir=\"${nodejs.libv8}\""
77 substituteInPlace ext/mini_racer_extension/extconf.rb \
78 --replace Libv8.configure_makefile '$CPPFLAGS += " -x c++"; Libv8.configure_makefile'
85 stdenvNoCC.mkDerivation {
86 inherit pname version src;
103 env.RAILS_ENV = "production";
105 pnpmDeps = pnpm.fetchDeps {
108 hash = "sha256-bdm1nkJnXE7oZZhG2uBnk3fYhITaMROHGKPbf0G3bFs=";
119 initdb -D postgres-work --encoding=utf8
120 pg_ctl start -D postgres-work -o "-k $PWD/postgres-work -h '''"
121 createuser -h $PWD/postgres-work zammad -R -S
122 createdb -h $PWD/postgres-work --encoding=utf8 --owner=zammad zammad
124 rake DATABASE_URL="postgresql:///zammad?host=$PWD/postgres-work" assets:precompile
127 pg_ctl stop -D postgres-work -m immediate
128 rm -r redis-work postgres-work
133 rm -rf $out/config/database.yml $out/config/secrets.yml $out/tmp $out/log
134 # dataDir will be set in the module, and the package gets overriden there
135 ln -s ${dataDir}/config/database.yml $out/config/database.yml
136 ln -s ${dataDir}/config/secrets.yml $out/config/secrets.yml
137 ln -s ${dataDir}/tmp $out/tmp
138 ln -s ${dataDir}/log $out/log
144 "${callPackage ./update.nix { }}/bin/update.sh"
149 inherit (nixosTests) zammad;
154 description = "Zammad, a web-based, open source user support/ticketing solution";
155 homepage = "https://zammad.org";
156 license = licenses.agpl3Plus;
161 maintainers = with maintainers; [