Hello there. Yep, I was unable to make Pleroma working. I examined the module in your self-hosted git repository and created a configuration snippet, based on those options and also on example, you provided in README.md(with a plenty of modifications)
{ pkgs, ... }:
let
pleromaModuleSrc = builtins.fetchTarball {
url = "https://git.alternativebit.fr/NinjaTrappeur/pleroma-otp-nixos/archive/master.tar.gz";
sha256 = "1rzq1nwapxfdq10b3xk5pmf3c22ig026bg5xb3cjay57yljp1b6s";
};
in
{
imports = [
"${pleromaModuleSrc}/modules/pleroma.nix"
./pleroma_config.nix
];
security.acme = {
certs = {
"pleroma.example.com" = {
webroot = "/var/www/pleroma.example.com";
email = "mail@example.com";
group = "nginx";
};
};
};
environment.etc."setup.psql".text = ''
CREATE USER pleroma WITH ENCRYPTED PASSWORD 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';
CREATE DATABASE pleroma OWNER pleroma;
\c pleroma;
--Extensions made by ecto.migrate that need superuser access
CREATE EXTENSION IF NOT EXISTS citext;
CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
'';
services = {
pleroma = {
enable = true;
};
postgresql = {
enable = true;
package = pkgs.postgresql_12;
initialScript = "/etc/setup.psql";
};
nginx = {
enable = true;
virtualHosts."pleroma.example.com" = {
sslCertificate = "/var/lib/acme/pleroma.example.com/fullchain.pem";
sslCertificateKey = "/var/lib/acme/pleroma.example.com/key.pem";
forceSSL = true;
root = "/var/www/pleroma.example.com";
locations."/" = {
proxyPass = "http://localhost:4000";
extraConfig = ''
add_header X-XSS-Protection "1; mode=block";
add_header X-Permitted-Cross-Domain-Policies none;
add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header Referrer-Policy same-origin;
add_header X-Download-Options noopen;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
client_max_body_size 16m;
'';
};
};
};
};
}
(This config, I posted there - is a final version of it. That’s the final state, with which, Pleroma refuses to work. Firstly, I haven’t got a declarative setup.psql
creation. I had to generate with those commands, you advised to use in a readme. Same goes for config.exs. I’m creating it declaratively inside pleroma_config.nix
as you can see in the import section. I won’t post it content here, due to privacy reasons).
First trouble, I bumped into, was an error, due to which Pleroma was unable to connect to the created Postgress database. I solved it pretty quick, when remembered, that you have to work with Postgresql from user postgres
. So I had to add this code snippet:
users.users.pleroma = {
extraGroups = [ "postgres" "wheel" ];
};
After that, I bumped into yet another error, that prevents me from running Pleroma for now:
systemctl status pleroma.service
gives me this:
pleroma.service - Pleroma social network
Loaded: loaded (/nix/store/210y3s3qwhzkhsq1rxnh5cgvjdszs63y-unit-pleroma.service/pleroma.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2020-11-07 11:12:45 UTC; 5min ago
Process: 26977 ExecStartPre=/nix/store/99d52b50xpapd35f8m355g3pir149jsq-pleromaStartPre/bin/pleromaStartPre (code=exited, status=0/SUCCESS)
Process: 27103 ExecStart=/nix/store/94fr23qvf3v3axiixvldahlp8srwf4w2-pleroma-otp-2.1.2/bin/pleroma daemon (code=exited, status=0/SUCCESS)
Process: 27202 ExecStop=/nix/store/94fr23qvf3v3axiixvldahlp8srwf4w2-pleroma-otp-2.1.2/bin/pleroma stop (code=exited, status=1/FAILURE)
Main PID: 27200 (code=exited, status=0/SUCCESS)
IP: 24.4K in, 3.6K out
CPU: 20.719s
Nov 07 11:12:20 ilchub systemd[1]: Starting Pleroma social network...
Nov 07 11:12:20 ilchub pleromaStartPre[26986]: /nix/store/94fr23qvf3v3axiixvldahlp8srwf4w2-pleroma-otp-2.1.2/erts-10.7.2.1/bin/beam.smp: /nix/store/gjkaxkg9rlklm52q92bvjr1ghkg8qjwj-ncurses-6.2/lib/libtinfo.so.6: no version information available (required by /nix/store/94fr23qvf3v3axiixvldahlp8srwf4w2-pleroma-otp-2.1.2/erts-10.7.2.1/bin/beam.smp)
Nov 07 11:12:25 ilchub pleromaStartPre[26986]: 11:12:25.380 [info] Already up
Nov 07 11:12:25 ilchub systemd[1]: Started Pleroma social network.
Nov 07 11:12:25 ilchub pleroma[27202]: /nix/store/94fr23qvf3v3axiixvldahlp8srwf4w2-pleroma-otp-2.1.2/erts-10.7.2.1/bin/beam.smp: /nix/store/gjkaxkg9rlklm52q92bvjr1ghkg8qjwj-ncurses-6.2/lib/libtinfo.so.6: no version information available (required by /nix/store/94fr23qvf3v3axiixvldahlp8srwf4w2-pleroma-otp-2.1.2/erts-10.7.2.1/bin/beam.smp)
Nov 07 11:12:26 ilchub pleroma[27202]: --rpc-eval : RPC failed with reason :nodedown
Nov 07 11:12:26 ilchub systemd[1]: pleroma.service: Control process exited, code=exited, status=1/FAILURE
Nov 07 11:12:45 ilchub systemd[1]: pleroma.service: Failed with result 'exit-code'.
Nov 07 11:12:45 ilchub systemd[1]: pleroma.service: Consumed 20.719s CPU time, received 24.4K IP traffic, sent 3.6K IP traffic.
I started searching for this error(no version information available
) and found a clue on archlinux forum. There was said, that Pleroma uses ncurses 5(when NixOS is shipped with ncurses 6). So I forked your repo to mine repo on BitBucket(https://bitbucket.org/ilchub/pleroma-otp-nixos/src/master/) and slightly modified default.nix
to make it building ncurses from source with ABI version 5
buildInputs = with pkgs; [
autoPatchelfHook
makeWrapper
(ncurses.override { abiVersion = "5"; })
openssl
zlib
];
But after that, Pleroma even refused to install, because yet, current version of Pleroma requires ncurses6, and clue I found, was for an older version. But that sends me back to the error: no version information available
. That’s a point, when I ran out of ideas
I hope, I provided enough information. If you need to know something more, just let me know.