commit 5eecc6533509bbdf3fd7a385de55a6d8fb785543 Author: Félix Baylac-Jacqué Date: Fri Sep 25 08:33:44 2020 +0200 pleroma-otp: init at 2.1.2 diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..a686035 --- /dev/null +++ b/default.nix @@ -0,0 +1,49 @@ +{ pkgs ? import {}, stdenv ? (import {}).stdenv }: + +stdenv.mkDerivation { + pname = "pleroma-otp"; + version = "2.1.2"; + + src = pkgs.fetchurl { + # To find the latest binary release stable link, have a look at + # the CI pipeline for the latest commit of the stable branch + # https://git.pleroma.social/pleroma/pleroma/-/tree/stable + url = "https://git.pleroma.social/pleroma/pleroma/-/jobs/154862/artifacts/download"; + sha256 = "16352ail4w1v0im5w1aq0z4lb1k85qa2qrr44pq12h0l6m05bc0z"; + }; + + nativeBuildInputs = [ pkgs.unzip ]; + + buildInputs = with pkgs; [ + autoPatchelfHook + makeWrapper + ncurses + openssl + zlib + ]; + + # mkDerivation fails to detect the zip nature of $src due to the + # missing .zip extension. + # Let's unpack the archive explicitely. + unpackCmd = "unzip $curSrc"; + + installPhase = '' + mkdir $out + cp -r * $out''; + + # Pleroma is using the project's root path (here the store path) + # as its TMPDIR. + # Patching it to move the tmp dir to the actual tmpdir + postFixup = '' + wrapProgram $out/bin/pleroma \ + --set-default RELEASE_TMP "/tmp" + wrapProgram $out/bin/pleroma_ctl \ + --set-default RELEASE_TMP "/tmp"''; + + meta = { + description = "ActivityPub microblogging server"; + homepage = https://git.pleroma.social/pleroma/pleroma; + license = stdenv.lib.licenses.agpl3; + maintainers = with stdenv.lib.maintainers; [ ninjatrappeur ]; + }; +}