2024-08-08 18:38:48 +00:00
|
|
|
{
|
|
|
|
lib,
|
2024-10-20 12:30:28 +00:00
|
|
|
stdenv,
|
2024-08-08 18:38:48 +00:00
|
|
|
beamPackages,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchFromGitLab,
|
|
|
|
fetchHex,
|
|
|
|
file,
|
|
|
|
cmake,
|
|
|
|
nixosTests,
|
|
|
|
writeText,
|
|
|
|
vips,
|
|
|
|
pkg-config,
|
|
|
|
glib,
|
2024-10-20 12:30:28 +00:00
|
|
|
darwin,
|
2024-08-08 18:38:48 +00:00
|
|
|
...
|
2021-06-06 10:30:13 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
beamPackages.mixRelease rec {
|
|
|
|
pname = "pleroma";
|
2024-08-08 18:38:48 +00:00
|
|
|
version = "2.7.0";
|
2021-06-06 10:30:13 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "git.pleroma.social";
|
|
|
|
owner = "pleroma";
|
|
|
|
repo = "pleroma";
|
2021-08-08 17:01:16 +00:00
|
|
|
rev = "v${version}";
|
2024-08-08 18:38:48 +00:00
|
|
|
sha256 = "sha256-2uKVwjxMLC8jyZWW+ltBRNtOR7RaAb8SPO1iV2wyROc=";
|
2021-06-06 10:30:13 +00:00
|
|
|
};
|
|
|
|
|
2024-08-08 18:38:48 +00:00
|
|
|
patches = [ ./Revert-Config-Restrict-permissions-of-OTP-config.patch ];
|
2023-08-07 22:41:47 +00:00
|
|
|
|
2021-06-06 10:30:13 +00:00
|
|
|
mixNixDeps = import ./mix.nix {
|
|
|
|
inherit beamPackages lib;
|
2023-07-02 18:50:45 +00:00
|
|
|
overrides = final: prev: {
|
2021-06-06 10:30:13 +00:00
|
|
|
# mix2nix does not support git dependencies yet,
|
|
|
|
# so we need to add them manually
|
2024-08-08 18:38:48 +00:00
|
|
|
captcha = beamPackages.buildMix {
|
2021-06-06 10:30:13 +00:00
|
|
|
name = "captcha";
|
|
|
|
version = "0.1.0";
|
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "git.pleroma.social";
|
2024-08-08 18:38:48 +00:00
|
|
|
owner = "pleroma/elixir-libraries";
|
2021-06-06 10:30:13 +00:00
|
|
|
repo = "elixir-captcha";
|
2024-02-20 11:59:37 +00:00
|
|
|
rev = "90f6ce7672f70f56708792a98d98bd05176c9176";
|
2024-08-08 18:38:48 +00:00
|
|
|
sha256 = "sha256-s7EuAhmCsQA/4p2NJHJSWB/DZ5hA+7EelPsUOvKr2Po=";
|
2021-06-06 10:30:13 +00:00
|
|
|
};
|
2024-08-08 18:38:48 +00:00
|
|
|
beamDeps = [ ];
|
|
|
|
};
|
|
|
|
prometheus_ex = beamPackages.buildMix {
|
|
|
|
name = "prometheus_ex";
|
|
|
|
version = "3.0.5";
|
2022-10-18 19:58:24 +00:00
|
|
|
|
2024-08-08 18:38:48 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "lanodan";
|
|
|
|
repo = "prometheus.ex";
|
|
|
|
rev = "31f7fbe4b71b79ba27efc2a5085746c4011ceb8f";
|
|
|
|
hash = "sha256-2PZP+YnwnHt69HtIAQvjMBqBbfdbkRSoMzb1AL2Zsyc=";
|
|
|
|
};
|
|
|
|
beamDeps = with final; [ prometheus ];
|
2021-06-06 10:30:13 +00:00
|
|
|
};
|
2024-08-08 18:38:48 +00:00
|
|
|
remote_ip = beamPackages.buildMix {
|
2021-06-06 10:30:13 +00:00
|
|
|
name = "remote_ip";
|
|
|
|
version = "0.1.5";
|
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "git.pleroma.social";
|
2024-08-08 18:38:48 +00:00
|
|
|
owner = "pleroma/elixir-libraries";
|
2021-06-06 10:30:13 +00:00
|
|
|
repo = "remote_ip";
|
|
|
|
rev = "b647d0deecaa3acb140854fe4bda5b7e1dc6d1c8";
|
2024-08-08 18:38:48 +00:00
|
|
|
hash = "sha256-pgON0uhTPVeeAC866Qz24Jvm1okoAECAHJrRzqaq+zA=";
|
2021-06-06 10:30:13 +00:00
|
|
|
};
|
2024-08-08 18:38:48 +00:00
|
|
|
beamDeps = with final; [
|
|
|
|
combine
|
|
|
|
plug
|
|
|
|
inet_cidr
|
|
|
|
];
|
2021-06-06 10:30:13 +00:00
|
|
|
};
|
2024-08-08 18:38:48 +00:00
|
|
|
majic = prev.majic.override { buildInputs = [ file ]; };
|
2021-06-06 10:30:13 +00:00
|
|
|
# Some additional build inputs and build fixes
|
|
|
|
http_signatures = prev.http_signatures.override {
|
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace mix.exs --replace ":logger" ":logger, :public_key"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
fast_html = prev.fast_html.override {
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
dontUseCmakeConfigure = true;
|
|
|
|
};
|
2024-08-08 18:38:48 +00:00
|
|
|
|
|
|
|
syslog = prev.syslog.override { buildPlugins = with beamPackages; [ pc ]; };
|
|
|
|
|
|
|
|
vix = prev.vix.override {
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2024-10-20 12:30:28 +00:00
|
|
|
buildInputs =
|
|
|
|
[
|
|
|
|
vips
|
|
|
|
glib.dev
|
|
|
|
]
|
2024-11-17 10:41:54 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-10-20 12:30:28 +00:00
|
|
|
darwin.apple_sdk.frameworks.Foundation
|
|
|
|
darwin.apple_sdk.frameworks.AppKit
|
|
|
|
darwin.apple_sdk.frameworks.Kerberos
|
|
|
|
];
|
2024-08-08 18:38:48 +00:00
|
|
|
VIX_COMPILATION_MODE = "PLATFORM_PROVIDED_LIBVIPS";
|
2021-06-06 10:30:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# This needs a different version (1.0.14 -> 1.0.18) to build properly with
|
|
|
|
# our Erlang/OTP version.
|
|
|
|
eimp = beamPackages.buildRebar3 rec {
|
|
|
|
name = "eimp";
|
|
|
|
version = "1.0.18";
|
|
|
|
|
|
|
|
src = beamPackages.fetchHex {
|
|
|
|
pkg = name;
|
|
|
|
inherit version;
|
|
|
|
sha256 = "0fnx2pm1n2m0zs2skivv43s42hrgpq9i143p9mngw9f3swjqpxvx";
|
|
|
|
};
|
|
|
|
|
|
|
|
patchPhase = ''
|
|
|
|
echo '{plugins, [pc]}.' >> rebar.config
|
|
|
|
'';
|
|
|
|
buildPlugins = with beamPackages; [ pc ];
|
|
|
|
|
|
|
|
beamDeps = with final; [ p1_utils ];
|
|
|
|
};
|
2022-12-25 12:38:55 +00:00
|
|
|
# Required by eimp
|
|
|
|
p1_utils = beamPackages.buildRebar3 rec {
|
|
|
|
name = "p1_utils";
|
|
|
|
version = "1.0.18";
|
|
|
|
|
|
|
|
src = fetchHex {
|
|
|
|
pkg = "${name}";
|
2023-07-02 18:50:45 +00:00
|
|
|
inherit version;
|
2022-12-25 12:38:55 +00:00
|
|
|
sha256 = "120znzz0yw1994nk6v28zql9plgapqpv51n9g6qm6md1f4x7gj0z";
|
|
|
|
};
|
|
|
|
|
2024-08-08 18:38:48 +00:00
|
|
|
beamDeps = [ ];
|
2022-12-25 12:38:55 +00:00
|
|
|
};
|
2021-06-06 10:30:13 +00:00
|
|
|
|
|
|
|
mime = prev.mime.override {
|
2024-08-08 18:38:48 +00:00
|
|
|
patchPhase =
|
|
|
|
let
|
|
|
|
cfgFile = writeText "config.exs" ''
|
|
|
|
use Mix.Config
|
|
|
|
config :mime, :types, %{
|
|
|
|
"application/activity+json" => ["activity+json"],
|
|
|
|
"application/jrd+json" => ["jrd+json"],
|
|
|
|
"application/ld+json" => ["activity+json"],
|
|
|
|
"application/xml" => ["xml"],
|
|
|
|
"application/xrd+xml" => ["xrd+xml"]
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
''
|
|
|
|
mkdir config
|
|
|
|
cp ${cfgFile} config/config.exs
|
2021-06-06 10:30:13 +00:00
|
|
|
'';
|
|
|
|
};
|
2023-07-02 18:50:45 +00:00
|
|
|
};
|
2021-06-06 10:30:13 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
tests.pleroma = nixosTests.pleroma;
|
|
|
|
inherit mixNixDeps;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "ActivityPub microblogging server";
|
2021-11-10 10:37:56 +00:00
|
|
|
homepage = "https://git.pleroma.social/pleroma/pleroma";
|
2024-03-19 12:26:06 +00:00
|
|
|
license = licenses.agpl3Only;
|
2024-08-08 18:38:48 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
picnoir
|
|
|
|
kloenk
|
|
|
|
yayayayaka
|
|
|
|
];
|
2021-12-07 08:40:38 +00:00
|
|
|
platforms = platforms.unix;
|
2021-06-06 10:30:13 +00:00
|
|
|
};
|
|
|
|
}
|