fediwall: init at 0.4.0 (#413666)

This commit is contained in:
Leona Maroni
2025-06-19 18:11:51 +02:00
committed by GitHub
6 changed files with 205 additions and 0 deletions
+11
View File
@@ -25573,6 +25573,17 @@
github = "tpwrules";
githubId = 208010;
};
transcaffeine = {
name = "transcaffeine";
email = "transcaffeine@finally.coffee";
github = "transcaffeine";
githubId = 139544537;
keys = [
{
fingerprint = "5E0A 9CB3 9806 57CB 9AB9 4AE6 790E AEC8 F99A B41F";
}
];
};
traverseda = {
email = "traverse.da@gmail.com";
github = "traverseda";
@@ -17,6 +17,8 @@
- [Pi-hole](https://pi-hole.net/), a DNS sinkhole for advertisements based on Dnsmasq. Available as [services.pihole-ftl](#opt-services.pihole-ftl.enable), and [services.pihole-web](#opt-services.pihole-web.enable) for the web GUI and API.
- [Fediwall](https://fediwall.social), a web application for live displaying toots from mastodon, inspired by mastowall. Available as [services.fediwall](#opt-services.fediwall.enable).
- [FileBrowser](https://filebrowser.org/), a web application for managing and sharing files. Available as [services.filebrowser](#opt-services.filebrowser.enable).
- Options under [networking.getaddrinfo](#opt-networking.getaddrinfo.enable) are now allowed to declaratively configure address selection and sorting behavior of `getaddrinfo` in dual-stack networks.
+1
View File
@@ -1544,6 +1544,7 @@
./services/web-apps/eintopf.nix
./services/web-apps/engelsystem.nix
./services/web-apps/ethercalc.nix
./services/web-apps/fediwall.nix
./services/web-apps/fider.nix
./services/web-apps/filebrowser.nix
./services/web-apps/filesender.nix
@@ -0,0 +1,128 @@
{
lib,
pkgs,
config,
...
}:
let
cfg = config.services.fediwall;
pkg = cfg.package.override { conf = cfg.settings; };
format = pkgs.formats.json { };
in
{
options.services.fediwall = {
enable = lib.mkEnableOption "fediwall, a social media wall for the fediverse";
package = lib.mkPackageOption pkgs "fediwall" { };
hostName = lib.mkOption {
type = lib.types.str;
default = config.networking.fqdnOrHostName;
defaultText = lib.literalExpression "config.networking.fqdnOrHostName";
example = "fediwall.example.org";
description = "The hostname to serve fediwall on.";
};
settings = lib.mkOption {
default = { };
description = ''
Fediwall configuration. See
https://github.com/defnull/fediwall/blob/main/public/wall-config.json.example
for information on supported values.
'';
type = lib.types.submodule {
freeformType = format.type;
options = {
servers = lib.mkOption {
type = with lib.types; listOf str;
default = [ "mastodon.social" ];
description = "Servers to load posts from";
};
tags = lib.mkOption {
type = with lib.types; listOf str;
default = [ ];
example = lib.literalExpression "[ \"cats\" \"dogs\"]";
description = "Tags to follow";
};
loadPublic = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Load public posts";
};
loadFederated = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Load federated posts";
};
loadTrends = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Load trending posts";
};
hideSensitive = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Hide sensitive (potentially NSFW) posts";
};
hideBots = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Hide posts from bot accounts";
};
hideReplies = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Hide replies";
};
hideBoosts = lib.mkOption {
type = lib.types.bool;
default = false;
description = "Hide boosts";
};
showMedia = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Show media in posts";
};
playVideos = lib.mkOption {
type = lib.types.bool;
default = true;
description = "Autoplay videos in posts";
};
};
};
};
nginx = lib.mkOption {
type = lib.types.submodule (
lib.recursiveUpdate (import ../web-servers/nginx/vhost-options.nix { inherit config lib; }) { }
);
default = { };
example = lib.literalExpression ''
{
serverAliases = [
"fedi.''${config.networking.domain}"
];
# Enable TLS and use let's encrypt for ACME
forceSSL = true;
enableACME = true;
}
'';
description = "Allows customizing the nginx virtualHost settings";
};
};
config = lib.mkIf cfg.enable {
services.nginx = {
enable = lib.mkDefault true;
virtualHosts."${cfg.hostName}" = lib.mkMerge [
cfg.nginx
{
root = lib.mkForce "${pkg}";
locations = {
"/" = {
index = "index.html";
};
};
}
];
};
};
}
@@ -0,0 +1,38 @@
{
lib,
fetchFromGitHub,
buildNpmPackage,
}:
let
version = "1.4.0";
in
buildNpmPackage {
pname = "fediwall";
inherit version;
src = fetchFromGitHub {
owner = "defnull";
repo = "fediwall";
tag = "v${version}";
hash = "sha256-aEY6mO7Es+H6CNE4shj/jz47nUeEIxGijKbUscIp0pM=";
};
npmDepsHash = "sha256-0VQ/CBqpQNqjg3lug+AQfFVbh0KhEaGwd+cEakBr/Dc=";
installPhase = ''
runHook preInstall
cp -r dist $out
runHook postInstall
'';
meta = {
description = "Social media wall for the Fediverse";
homepage = "https://fediwall.social";
license = lib.licenses.agpl3Plus;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ transcaffeine ];
};
}
+25
View File
@@ -0,0 +1,25 @@
{
lib,
stdenv,
fediwall-unwrapped,
conf ? { },
}:
if (conf == { }) then
fediwall-unwrapped
else
stdenv.mkDerivation {
pname = "fediwall";
inherit (fediwall-unwrapped) version meta;
dontUnpack = true;
installPhase = ''
runHook preInstall
mkdir -p $out
ln -s ${fediwall-unwrapped}/* $out
echo ${lib.escapeShellArg (builtins.toJSON conf)} \
> "$out/wall-config.json"
runHook postInstall
'';
}