style: format tree

This commit is contained in:
nhnn
2025-06-18 19:53:44 +03:00
parent ed990906bd
commit 86233cac27
44 changed files with 2523 additions and 2253 deletions

View File

@@ -5,13 +5,8 @@ in
# FIXME do we really want to delete passwords on module deactivation!?
{
config = lib.mkIf (!sp.modules.pleroma.enable) {
system.activationScripts.pleroma =
lib.trivial.warn
(
"pleroma service is disabled, ${secrets-exs} will be removed!"
)
''
rm -f -v ${secrets-exs}
'';
system.activationScripts.pleroma = lib.trivial.warn ("pleroma service is disabled, ${secrets-exs} will be removed!") ''
rm -f -v ${secrets-exs}
'';
};
}

View File

@@ -1,5 +1,4 @@
config:
{
config: {
sp = config.selfprivacy;
secrets-exs = "/var/lib/pleroma/secrets.exs";
}

View File

@@ -1,35 +1,38 @@
{
description = "PoC SP module for Pleroma lightweight fediverse server";
outputs = { self }: {
nixosModules.default = import ./module.nix;
configPathsNeeded =
builtins.fromJSON (builtins.readFile ./config-paths-needed.json);
meta = { lib, ... }: {
spModuleSchemaVersion = 1;
id = "pleroma";
name = "Pleroma";
description = "Pleroma is a microblogging service that offers a web interface and a desktop client.";
svgIcon = builtins.readFile ./icon.svg;
isMovable = true;
isRequired = false;
canBeBackedUp = true;
backupDescription = "Your Pleroma accounts, posts and media.";
systemdServices = [
"pleroma.service"
];
folders = [
"/var/lib/pleroma"
];
postgreDatabases = [
"pleroma"
];
license = [
lib.licenses.agpl3Only
];
homepage = "https://pleroma.social/";
sourcePage = "https://git.pleroma.social/pleroma/pleroma";
supportLevel = "deprecated";
outputs =
{ self }:
{
nixosModules.default = import ./module.nix;
configPathsNeeded = builtins.fromJSON (builtins.readFile ./config-paths-needed.json);
meta =
{ lib, ... }:
{
spModuleSchemaVersion = 1;
id = "pleroma";
name = "Pleroma";
description = "Pleroma is a microblogging service that offers a web interface and a desktop client.";
svgIcon = builtins.readFile ./icon.svg;
isMovable = true;
isRequired = false;
canBeBackedUp = true;
backupDescription = "Your Pleroma accounts, posts and media.";
systemdServices = [
"pleroma.service"
];
folders = [
"/var/lib/pleroma"
];
postgreDatabases = [
"pleroma"
];
license = [
lib.licenses.agpl3Only
];
homepage = "https://pleroma.social/";
sourcePage = "https://git.pleroma.social/pleroma/pleroma";
supportLevel = "deprecated";
};
};
};
}

View File

@@ -1,4 +1,9 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
secrets-filepath = "/etc/selfprivacy/secrets.json";
cfg = config.selfprivacy.modules.pleroma;
@@ -6,35 +11,41 @@ let
in
{
options.selfprivacy.modules.pleroma = {
enable = (lib.mkOption {
default = false;
type = lib.types.bool;
description = "Enable";
}) // {
meta = {
type = "enable";
enable =
(lib.mkOption {
default = false;
type = lib.types.bool;
description = "Enable";
})
// {
meta = {
type = "enable";
};
};
};
location = (lib.mkOption {
type = lib.types.str;
description = "Location";
}) // {
meta = {
type = "location";
location =
(lib.mkOption {
type = lib.types.str;
description = "Location";
})
// {
meta = {
type = "location";
};
};
};
subdomain = (lib.mkOption {
default = "social";
type = lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9\-]{0,61}[A-Za-z0-9]";
description = "Subdomain";
}) // {
meta = {
widget = "subdomain";
type = "string";
regex = "[A-Za-z0-9][A-Za-z0-9\-]{0,61}[A-Za-z0-9]";
weight = 0;
subdomain =
(lib.mkOption {
default = "social";
type = lib.types.strMatching "[A-Za-z0-9][A-Za-z0-9\-]{0,61}[A-Za-z0-9]";
description = "Subdomain";
})
// {
meta = {
widget = "subdomain";
type = "string";
regex = "[A-Za-z0-9][A-Za-z0-9\-]{0,61}[A-Za-z0-9]";
weight = 0;
};
};
};
};
config = lib.mkIf cfg.enable {
fileSystems = lib.mkIf sp.useBinds {
@@ -55,10 +66,9 @@ in
user = "pleroma";
group = "pleroma";
configs = [
(builtins.replaceStrings
[ "$DOMAIN" "$LUSER" ]
[ sp.domain sp.username ]
(builtins.readFile ./config.exs.in))
(builtins.replaceStrings [ "$DOMAIN" "$LUSER" ] [ sp.domain sp.username ] (
builtins.readFile ./config.exs.in
))
];
};
postgresql = {
@@ -94,7 +104,10 @@ in
before = [ "pleroma.service" ];
requiredBy = [ "pleroma.service" ];
serviceConfig.Type = "oneshot";
path = with pkgs; [ coreutils jq ];
path = with pkgs; [
coreutils
jq
];
script = ''
set -o nounset