2024-08-19 12:14:29 +02:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
beam_nox,
|
|
|
|
fetchFromGitHub,
|
|
|
|
cmake,
|
|
|
|
nixosTests,
|
|
|
|
src,
|
|
|
|
src-config,
|
|
|
|
mobilizon-js,
|
2023-08-03 16:59:12 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2024-11-09 16:06:38 +01:00
|
|
|
beamPackages = beam_nox.packages.erlang.extend (self: super: {
|
|
|
|
elixir = super.elixir_1_15;
|
|
|
|
});
|
|
|
|
inherit (beamPackages) mixRelease buildMix elixir;
|
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-04-10 15:40:57 +02:00
|
|
|
version = "5.0.0-beta.1";
|
2023-08-03 16:59:12 +02:00
|
|
|
|
|
|
|
inherit src;
|
|
|
|
|
2024-08-19 12:13:03 +02:00
|
|
|
# Update deps.nix by running `mix deps.nix`
|
|
|
|
mixNixDeps = import ./deps.nix {
|
2024-06-24 15:24:09 +02:00
|
|
|
inherit lib;
|
|
|
|
beamPackages = beam_nox.packages.erlang;
|
2024-08-19 12:14:29 +02:00
|
|
|
overrides = (
|
|
|
|
final: prev:
|
|
|
|
(lib.mapAttrs (_: value: value.override { appConfigPath = src-config; }) 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}";
|
2024-08-19 12:14:29 +02:00
|
|
|
sha256 =
|
|
|
|
assert old.version == "2.37.5";
|
2023-12-02 03:54:04 +01:00
|
|
|
"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/
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
|
2024-08-19 12:14:29 +02:00
|
|
|
}
|
|
|
|
);
|
2023-08-03 16:59:12 +02:00
|
|
|
};
|
|
|
|
|
2024-08-19 12:29:22 +02:00
|
|
|
# fix elixir locale warning
|
|
|
|
env.LANG = "C.UTF-8";
|
2023-08-03 16:59:12 +02:00
|
|
|
|
|
|
|
# Install the compiled js part
|
2024-08-19 12:14:29 +02:00
|
|
|
preBuild = ''
|
|
|
|
cp -a "${mobilizon-js}/_napalm-install/priv/static" ./priv
|
|
|
|
chmod 770 -R ./priv
|
|
|
|
'';
|
2023-08-03 16:59:12 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2024-08-19 12:29:22 +02:00
|
|
|
passthru.elixirPackage = elixir;
|
2023-11-06 00:24:08 +01:00
|
|
|
|
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;
|
2024-08-19 12:14:29 +02:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
minijackson
|
|
|
|
erictapen
|
|
|
|
];
|
2023-08-03 16:59:12 +02:00
|
|
|
};
|
|
|
|
}
|