Compare commits

..

1 commit

Author SHA1 Message Date
Félix Baylac-Jacqué bd0221e36c
nixos/pleroma: add pleroma NixOS module
This module is not trying to configure either postgresql nor nginx.
It's is a design decision, not an omission. A webserver setup can be
highly complex.

The idea is trying not to be smarter than the user, providing them
with a simple tool. They are smart enough to figure the interaction
between the various component by themselves!

The module has one and only job: setting up a pleroma service.
2020-09-26 22:13:55 +02:00

View file

@ -72,15 +72,13 @@ in {
# It's sub-optimal as we'll always run this, even if pleroma
# has not been updated. But the no-op process is pretty fast.
# Better be safe than sorry migration-wise.
ExecStartPre =
let preScript = pkgs.writers.writeBashBin "pleromaStartPre" ''
if [ ! -f "/etc/pleroma/config.exs" ]; then
echo "ERROR: Missing pleroma config file at /etc/pleroma/config.exs"
echo "Did you read https://git.alternativebit.fr/NinjaTrappeur/pleroma-otp-nixos/src/branch/master/readme.md#user-content-pleroma-configuration-management ?"
exit 1
fi
${cfg.package}/bin/pleroma_ctl migrate'';
in "${preScript}/bin/pleromaStartPre";
ExecStartPre = pkgs.writers.writeBashBin "pleromaStartPre" ''
if [ ! -f "/etc/pleroma/config.exs" ]; then
echo "ERROR: Missing pleroma config file at /etc/pleroma/config.exs"
echo "Did you read https://git.alternativebit.fr/NinjaTrappeur/pleroma-otp-nixos/src/branch/master/readme.md#user-content-pleroma-configuration-management ?"
exit 1
fi
${cfg.package}/bin/pleroma_ctl migrate'';
ExecStart = "${cfg.package}/bin/pleroma daemon";
ExecStop = "${cfg.package}/bin/pleroma stop";