Merge branch 'staging/pleroma-update'

This commit is contained in:
colin 2022-10-25 04:18:25 -07:00
commit a6cbecbc74
4 changed files with 66 additions and 26 deletions

View File

@ -74,9 +74,10 @@
config :pleroma, configurable_from_database: false config :pleroma, configurable_from_database: false
# strip metadata from uploaded images # strip metadata from uploaded images
config :pleroma, Pleroma.Upload, filters: [Pleroma.Upload.Filter.Exiftool] config :pleroma, Pleroma.Upload, filters: [Pleroma.Upload.Filter.Exiftool.StripLocation]
# TODO: GET /api/pleroma/captcha is broken # TODO: GET /api/pleroma/captcha is broken
# there was a nixpkgs PR to fix this around 2022/10 though.
config :pleroma, Pleroma.Captcha, config :pleroma, Pleroma.Captcha,
enabled: false, enabled: false,
method: Pleroma.Captcha.Native method: Pleroma.Captcha.Native

View File

@ -1,6 +1,7 @@
{ lib, beamPackages { lib, beamPackages
, fetchFromGitHub, fetchFromGitLab , fetchFromGitHub, fetchFromGitLab
, file, cmake, bash , file, cmake, bash
, libxcrypt
, nixosTests, writeText , nixosTests, writeText
, cookieFile ? "/var/lib/pleroma/.cookie" , cookieFile ? "/var/lib/pleroma/.cookie"
, ... , ...
@ -14,11 +15,10 @@ beamPackages.mixRelease rec {
domain = "git.pleroma.social"; domain = "git.pleroma.social";
owner = "pleroma"; owner = "pleroma";
repo = "pleroma"; repo = "pleroma";
rev = "4605efe272016a5ba8ba6e96a9bec9a6e40c1591"; rev = "7a519b6a6607bc1dd22e6a3450aebf0f1ff11fb8";
# to update: uncomment the null hash, run nixos-rebuild and # to update: uncomment the null hash, run nixos-rebuild and
# compute the new hash with `nix to-sri sha256:<output from failed nix build>` # compute the new hash with `nix to-sri sha256:<output from failed nix build>`
# sha256 = "sha256-0000000000000000000000000000000000000000000="; sha256 = "sha256-6NglBcEGEvRlYMnVNB8kr4i/fccrzO6mnyp3X+O0m74=";
sha256 = "sha256-Dp1kTUDfNC7EDoK9WToXkUvsj7v66eKuD15le5IZgiY=";
}; };
preFixup = if (cookieFile != null) then '' preFixup = if (cookieFile != null) then ''
@ -72,29 +72,49 @@ beamPackages.mixRelease rec {
name = "crypt"; name = "crypt";
version = "0.4.3"; version = "0.4.3";
src = fetchFromGitHub { # src = fetchFromGitHub {
owner = "msantos"; # owner = "msantos";
# repo = "crypt";
# rev = "f75cd55325e33cbea198fb41fe41871392f8fb76";
# sha256 = "sha256-ZYhZTe7cTITkl8DZ4z2IOlxTX5gnbJImu/lVJ2ZjR1o=";
# };
# this is the old crypt, from before 2021/09/21.
# nixpkgs still uses this as of 2022-10-24 and it works.
src = fetchFromGitLab {
domain = "git.pleroma.social";
group = "pleroma";
owner = "elixir-libraries";
repo = "crypt"; repo = "crypt";
rev = "f75cd55325e33cbea198fb41fe41871392f8fb76"; rev = "cf2aa3f11632e8b0634810a15b3e612c7526f6a3";
sha256 = "sha256-ZYhZTe7cTITkl8DZ4z2IOlxTX5gnbJImu/lVJ2ZjR1o="; sha256 = "sha256-48QIsgyEaDzvnihdsFy7pYURLFcb9G8DXIrf5Luk3zo=";
}; };
postInstall = "mv $out/lib/erlang/lib/crypt-${version}/priv/{source,crypt}.so"; postInstall = "mv $out/lib/erlang/lib/crypt-${version}/priv/{source,crypt}.so";
beamDeps = with final; [ elixir_make ]; beamDeps = with final; [ elixir_make ];
buildInputs = [ libxcrypt ];
}; };
prometheus_ex = beamPackages.buildMix rec { prometheus_ex = beamPackages.buildMix rec {
name = "prometheus_ex"; name = "prometheus_ex";
version = "3.0.5"; version = "3.0.5";
src = fetchFromGitLab { src = fetchFromGitHub {
domain = "git.pleroma.social"; owner = "lanodan";
group = "pleroma";
owner = "elixir-libraries";
repo = "prometheus.ex"; repo = "prometheus.ex";
rev = "a4e9beb3c1c479d14b352fd9d6dd7b1f6d7deee5"; # branch = "fix/elixir-1.14";
sha256 = "1v0q4bi7sb253i8q016l7gwlv5562wk5zy3l2sa446csvsacnpjk"; rev = "31f7fbe4b71b79ba27efc2a5085746c4011ceb8f";
sha256 = "sha256-2PZP+YnwnHt69HtIAQvjMBqBbfdbkRSoMzb1AL2Zsyc=";
}; };
# src = fetchFromGitLab {
# domain = "git.pleroma.social";
# group = "pleroma";
# owner = "elixir-libraries";
# repo = "prometheus.ex";
# rev = "a4e9beb3c1c479d14b352fd9d6dd7b1f6d7deee5";
# sha256 = "1v0q4bi7sb253i8q016l7gwlv5562wk5zy3l2sa446csvsacnpjk";
# };
beamDeps = with final; [ prometheus ]; beamDeps = with final; [ prometheus ];
}; };
prometheus_phx = beamPackages.buildMix rec { prometheus_phx = beamPackages.buildMix rec {
@ -109,8 +129,8 @@ beamPackages.mixRelease rec {
group = "pleroma"; group = "pleroma";
owner = "elixir-libraries"; owner = "elixir-libraries";
repo = "prometheus-phx"; repo = "prometheus-phx";
rev = "9cd8f248c9381ffedc799905050abce194a97514"; rev = "0c950ac2d145b1ee3fc8ee5c3290ccb9ef2331e9";
sha256 = "0211z4bxb0bc0zcrhnph9kbbvvi1f2v95madpr96pqzr60y21cam"; sha256 = "sha256-HjN0ku1q5aNtrhHopch0wpp4Z+dMCGj5GxHroiz5u/w=";
}; };
beamDeps = with final; [ prometheus_ex ]; beamDeps = with final; [ prometheus_ex ];
}; };

View File

@ -34,7 +34,6 @@ let
beamDeps = [ custom_base ]; beamDeps = [ custom_base ];
}; };
# base64url = buildMix rec {
base64url = buildRebar3 rec { base64url = buildRebar3 rec {
name = "base64url"; name = "base64url";
version = "0.0.1"; version = "0.0.1";
@ -362,12 +361,12 @@ let
eblurhash = buildRebar3 rec { eblurhash = buildRebar3 rec {
name = "eblurhash"; name = "eblurhash";
version = "1.1.0"; version = "1.2.2";
src = fetchHex { src = fetchHex {
pkg = "${name}"; pkg = "${name}";
version = "${version}"; version = "${version}";
sha256 = "07dmkbyafpxffh8ar6af4riqfxiqc547rias7i73gpgx16fqhsrf"; sha256 = "0k040pj8hlm8mwy0ra459hk35v9gfsvvgp596nl27q2dj00cl84c";
}; };
beamDeps = []; beamDeps = [];
@ -1646,5 +1645,19 @@ let
beamDeps = [ httpoison jose ]; beamDeps = [ httpoison jose ];
}; };
websockex = buildMix rec {
name = "websockex";
version = "0.4.3";
src = fetchHex {
pkg = "${name}";
version = "${version}";
sha256 = "1r2kmi2pcmdzvgbd08ci9avy0g5p2lhx80jn736a98w55c3ygwlm";
};
beamDeps = [];
};
}; };
in self in self

View File

@ -1,10 +1,16 @@
in pleroma checkout:
- grab version: `rg 'version: ' mix.exs`
in default.nix: in default.nix:
update `rev` and recompute sha256. - update `rev` and recompute sha256.
use nix to-sri sha256:<expected>
run mix2nix inside the pleroma git root and pipe the output into mix.nix in pleroma checkout:
inside default.nix, update all git mix deps - `mix2nix > mix.nix`
inside mix.nix, change base64url to use buildRebar3 instead of buildMix
move majic from mix.nix -> default.nix and add: in nix repo:
buildInputs = [ file ]; - cp the new mix.nix here.
- move majic from mix.nix -> default.nix and add:
- buildInputs = [ file ];
- update `mixNixDeps` in default.nix:
- grab the version from pleroma/mix.exs or mix.lock
- redundant?: inside mix.nix, change base64url to use buildRebar3 instead of buildMix