2 , fetchFromGitHub, fetchFromGitLab, fetchHex
4 , nixosTests, writeText
8 beamPackages.mixRelease rec {
12 src = fetchFromGitLab {
13 domain = "git.pleroma.social";
17 sha256 = "sha256-ZiupcCu6ES/G9rsdNo5+JXOIPhb4CHT2YhKThWiLisw=";
21 ./Revert-Config-Restrict-permissions-of-OTP-config.patch
24 mixNixDeps = import ./mix.nix {
25 inherit beamPackages lib;
26 overrides = final: prev: {
27 # mix2nix does not support git dependencies yet,
28 # so we need to add them manually
29 prometheus_ex = beamPackages.buildMix rec {
30 name = "prometheus_ex";
33 src = fetchFromGitHub {
35 repo = "prometheus.ex";
36 rev = "31f7fbe4b71b79ba27efc2a5085746c4011ceb8f";
37 sha256 = "sha256-2PZP+YnwnHt69HtIAQvjMBqBbfdbkRSoMzb1AL2Zsyc=";
39 beamDeps = with final; [ prometheus ];
41 captcha = beamPackages.buildMix rec {
45 src = fetchFromGitLab {
46 domain = "git.pleroma.social";
48 owner = "elixir-libraries";
49 repo = "elixir-captcha";
50 rev = "90f6ce7672f70f56708792a98d98bd05176c9176";
51 hash = "sha256-s7EuAhmCsQA/4p2NJHJSWB/DZ5hA+7EelPsUOvKr2Po=";
53 beamDeps = with final; [ ];
55 postInstall = "mv priv/* $out/lib/erlang/lib/${name}-${version}/priv/";
57 remote_ip = beamPackages.buildMix rec {
61 src = fetchFromGitLab {
62 domain = "git.pleroma.social";
64 owner = "elixir-libraries";
66 rev = "b647d0deecaa3acb140854fe4bda5b7e1dc6d1c8";
67 sha256 = "0c7vmakcxlcs3j040018i7bfd6z0yq6fjfig02g5fgakx398s0x6";
69 beamDeps = with final; [ combine plug inet_cidr ];
71 prometheus_phx = beamPackages.buildMix rec {
72 name = "prometheus_phx";
78 src = fetchFromGitLab {
79 domain = "git.pleroma.social";
81 owner = "elixir-libraries";
82 repo = "prometheus-phx";
83 rev = "9cd8f248c9381ffedc799905050abce194a97514";
84 sha256 = "0211z4bxb0bc0zcrhnph9kbbvvi1f2v95madpr96pqzr60y21cam";
86 beamDeps = with final; [ prometheus_ex ];
88 majic = prev.majic.override {
89 buildInputs = [ file ];
91 # Some additional build inputs and build fixes
92 http_signatures = prev.http_signatures.override {
94 substituteInPlace mix.exs --replace ":logger" ":logger, :public_key"
97 fast_html = prev.fast_html.override {
98 nativeBuildInputs = [ cmake ];
99 dontUseCmakeConfigure = true;
101 syslog = prev.syslog.override {
102 buildPlugins = with beamPackages; [ pc ];
105 # This needs a different version (1.0.14 -> 1.0.18) to build properly with
106 # our Erlang/OTP version.
107 eimp = beamPackages.buildRebar3 rec {
111 src = beamPackages.fetchHex {
114 sha256 = "0fnx2pm1n2m0zs2skivv43s42hrgpq9i143p9mngw9f3swjqpxvx";
118 echo '{plugins, [pc]}.' >> rebar.config
120 buildPlugins = with beamPackages; [ pc ];
122 beamDeps = with final; [ p1_utils ];
125 p1_utils = beamPackages.buildRebar3 rec {
132 sha256 = "120znzz0yw1994nk6v28zql9plgapqpv51n9g6qm6md1f4x7gj0z";
138 mime = prev.mime.override {
140 cfgFile = writeText "config.exs" ''
142 config :mime, :types, %{
143 "application/activity+json" => ["activity+json"],
144 "application/jrd+json" => ["jrd+json"],
145 "application/ld+json" => ["activity+json"],
146 "application/xml" => ["xml"],
147 "application/xrd+xml" => ["xrd+xml"]
152 cp ${cfgFile} config/config.exs
159 tests.pleroma = nixosTests.pleroma;
164 description = "ActivityPub microblogging server";
165 homepage = "https://git.pleroma.social/pleroma/pleroma";
166 license = licenses.agpl3Only;
167 maintainers = with maintainers; [ picnoir kloenk yayayayaka ];
168 platforms = platforms.unix;