@@ -1,5 +1,13 @@
1−{ lib, stdenv, beamPackages, fetchFromGitHub, glibcLocales, cacert
2−, mkYarnModules, nodejs, fetchpatch, nixosTests
1+{ lib
2+, stdenv
3+, beamPackages
4+, fetchFromGitHub
5+, glibcLocales
6+, cacert
7+, mkYarnModules
8+, nodejs
9+, fetchpatch
10+, nixosTests
311}:
412
513let
@@ -37,7 +45,8 @@ let
3745 echo 'module.exports = {}' > $out/node_modules/flatpickr/dist/postcss.config.js
3846 '';
3947 };
40−in beamPackages.mixRelease {
48+in
49+beamPackages.mixRelease {
4150 inherit pname version src mixFodDeps;
4251
4352 nativeBuildInputs = [ nodejs ];
@@ -50,6 +59,10 @@ in beamPackages.mixRelease {
5059 sha256 = "sha256-JvJ7xlGw+tHtWje+jiQChVC4KTyqqdq2q+MIcOv/k1o=";
5160 })
5261
62+ # Ensure that `tzdata` doesn't write into its store-path
63+ # https://github.com/plausible/analytics/pull/1096, but rebased onto 1.3.0
64+ ./tzdata-rebased.patch
65+
5366 # CREATE EXTENSION requires super-user privileges. To avoid that, we just skip
5467 # the responsible SQL statement here and take care of it in the module.
5568 ./skip-create-ext.patch
@@ -60,25 +73,13 @@ in beamPackages.mixRelease {
6073 updateScript = ./update.sh;
6174 };
6275
63− postPatch = ''
64− # Without this modification, tzdata tries to write in its store-path:
65− # https://github.com/lau/tzdata#data-directory-and-releases
66− echo 'config :tzdata, :data_dir, (System.get_env("PLAUSIBLE_TZDATA") || "/tmp/plausible_tzdata")' \
67− >> config/config.exs
68− '';
69−
70− buildPhase = ''
71− runHook preBuild
72−
73− mkdir -p $out
76+ postBuild = ''
7477 ln -sf ${yarnDeps}/node_modules assets/node_modules
7578 npm run deploy --prefix ./assets
7679
7780 # for external task you need a workaround for the no deps check flag
7881 # https://github.com/phoenixframework/phoenix/issues/2690
7982 mix do deps.loadpaths --no-deps-check, phx.digest
80−
81− runHook postBuild
8283 '';
8384
8485 meta = with lib; {