2023-08-03 16:59:12 +02:00
|
|
|
{ lib
|
2023-11-06 18:06:43 +01:00
|
|
|
, beamPackages
|
2023-08-03 16:59:12 +02:00
|
|
|
, fetchFromGitHub
|
|
|
|
, git
|
|
|
|
, cmake
|
|
|
|
, nixosTests
|
|
|
|
, src
|
2023-08-10 20:43:08 +02:00
|
|
|
, src-config
|
2023-08-03 17:26:07 +02:00
|
|
|
, mobilizon-js
|
2023-08-03 16:59:12 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2023-11-06 18:06:43 +01:00
|
|
|
inherit (beamPackages) mixRelease buildMix;
|
2023-08-03 16:59:12 +02:00
|
|
|
in
|
|
|
|
mixRelease rec {
|
|
|
|
pname = "mobilizon";
|
2024-02-29 18:40:01 +01:00
|
|
|
|
|
|
|
# This has to be kept in sync with the version in mix.exs and package.json!
|
|
|
|
# Otherwise the nginx routing isn't going to work properly.
|
2024-02-29 14:50:14 +01:00
|
|
|
version = "4.1.0-alpha.1";
|
2023-08-03 16:59:12 +02:00
|
|
|
|
|
|
|
inherit src;
|
|
|
|
|
|
|
|
# See https://github.com/whitfin/cachex/issues/205
|
|
|
|
# This circumvents a startup error for now
|
|
|
|
stripDebug = false;
|
|
|
|
|
|
|
|
nativeBuildInputs = [ git cmake ];
|
|
|
|
|
|
|
|
mixNixDeps = import ./mix.nix {
|
|
|
|
inherit beamPackages lib;
|
|
|
|
overrides = (final: prev:
|
|
|
|
(lib.mapAttrs
|
|
|
|
(_: value: value.override {
|
2023-08-10 20:43:08 +02:00
|
|
|
appConfigPath = src-config;
|
2023-08-03 16:59:12 +02:00
|
|
|
})
|
|
|
|
prev) // {
|
|
|
|
fast_html = prev.fast_html.override {
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
};
|
2023-12-02 03:54:04 +01:00
|
|
|
ex_cldr = prev.ex_cldr.overrideAttrs (old: {
|
2023-08-03 16:59:12 +02:00
|
|
|
# We have to use the GitHub sources, as it otherwise tries to download
|
|
|
|
# the locales at build time.
|
|
|
|
src = fetchFromGitHub {
|
2023-09-08 13:32:47 +02:00
|
|
|
owner = "elixir-cldr";
|
2023-08-03 16:59:12 +02:00
|
|
|
repo = "cldr";
|
2023-12-02 03:54:04 +01:00
|
|
|
rev = "v${old.version}";
|
|
|
|
sha256 = assert old.version == "2.37.5";
|
|
|
|
"sha256-T5Qvuo+xPwpgBsqHNZYnTCA4loToeBn1LKTMsDcCdYs=";
|
2023-08-03 16:59:12 +02:00
|
|
|
};
|
|
|
|
postInstall = ''
|
|
|
|
cp $src/priv/cldr/locales/* $out/lib/erlang/lib/ex_cldr-${old.version}/priv/cldr/locales/
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
# Upstream issue: https://github.com/bryanjos/geo_postgis/pull/87
|
|
|
|
geo_postgis = prev.geo_postgis.overrideAttrs (old: {
|
|
|
|
propagatedBuildInputs = old.propagatedBuildInputs ++ [ final.ecto ];
|
|
|
|
});
|
|
|
|
|
|
|
|
# The remainder are Git dependencies (and their deps) that are not supported by mix2nix currently.
|
|
|
|
web_push_encryption = buildMix rec {
|
|
|
|
name = "web_push_encryption";
|
|
|
|
version = "0.3.1";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "danhper";
|
|
|
|
repo = "elixir-web-push-encryption";
|
2024-02-08 18:53:07 +01:00
|
|
|
rev = "6e143dcde0a2854c4f0d72816b7ecab696432779";
|
|
|
|
sha256 = "sha256-Da+/28SPZuUQBi8fQj31zmMvhMrYUaQIW4U4E+mRtMg=";
|
2023-08-03 16:59:12 +02:00
|
|
|
};
|
|
|
|
beamDeps = with final; [ httpoison jose ];
|
|
|
|
};
|
|
|
|
icalendar = buildMix rec {
|
|
|
|
name = "icalendar";
|
|
|
|
version = "unstable-2022-04-10";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tcitworld";
|
|
|
|
repo = name;
|
|
|
|
rev = "1033d922c82a7223db0ec138e2316557b70ff49f";
|
|
|
|
sha256 = "sha256-N3bJZznNazLewHS4c2B7LP1lgxd1wev+EWVlQ7rOwfU=";
|
|
|
|
};
|
|
|
|
beamDeps = with final; [ mix_test_watch ex_doc timex ];
|
|
|
|
};
|
|
|
|
rajska = buildMix rec {
|
|
|
|
name = "rajska";
|
|
|
|
version = "1.3.3";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tcitworld";
|
|
|
|
repo = name;
|
|
|
|
rev = "0c036448e261e8be6a512581c592fadf48982d84";
|
|
|
|
sha256 = "sha256-4pfply1vTAIT2Xvm3kONmrCK05xKfXFvcb8EKoSCXBE=";
|
|
|
|
};
|
|
|
|
beamDeps = with final; [ ex_doc credo absinthe excoveralls hammer mock ];
|
|
|
|
};
|
|
|
|
exkismet = buildMix rec {
|
|
|
|
name = "exkismet";
|
|
|
|
version = "0.0.3";
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tcitworld";
|
|
|
|
repo = name;
|
|
|
|
rev = "8b5485fde00fafbde20f315bec387a77f7358334";
|
|
|
|
sha256 = "sha256-ttgCWoBKU7VTjZJBhZNtqVF4kN7psBr/qOeR65MbTqw=";
|
|
|
|
};
|
|
|
|
beamDeps = with final; [ httpoison ex_doc credo doctor dialyxir ];
|
|
|
|
};
|
|
|
|
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
export LANG=C.UTF-8 # fix elixir locale warning
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Install the compiled js part
|
|
|
|
preBuild =
|
|
|
|
''
|
2023-11-21 16:38:36 +01:00
|
|
|
cp -a "${mobilizon-js}/_napalm-install/priv/static" ./priv
|
2023-08-03 16:59:12 +02:00
|
|
|
chmod 770 -R ./priv
|
|
|
|
'';
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
mix phx.digest --no-deps-check
|
|
|
|
'';
|
|
|
|
|
2023-12-02 04:26:04 +01:00
|
|
|
# Just a hack to reduce path size by 60MB
|
|
|
|
postInstall =
|
|
|
|
let
|
|
|
|
inherit (mixNixDeps) ex_cldr;
|
|
|
|
in
|
|
|
|
''
|
|
|
|
rm -r $out/lib/ex_cldr-${ex_cldr.version}/priv/cldr/locales
|
|
|
|
ln -s ${ex_cldr.src}/priv/cldr/locales $out/lib/ex_cldr-${ex_cldr.version}/priv/cldr/locales
|
|
|
|
'';
|
|
|
|
|
2023-11-06 00:24:08 +01:00
|
|
|
passthru.elixirPackage = beamPackages.elixir;
|
|
|
|
|
2023-08-03 16:59:12 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Mobilizon is an online tool to help manage your events, your profiles and your groups";
|
|
|
|
homepage = "https://joinmobilizon.org/";
|
|
|
|
license = licenses.agpl3Plus;
|
|
|
|
maintainers = with maintainers; [ minijackson erictapen ];
|
|
|
|
};
|
|
|
|
}
|