This commit is contained in:
emily 2024-11-14 19:11:10 +01:00
parent 923ca6cd9a
commit f8765b410a
Signed by: emily
GPG key ID: F6F4C66207FCF995
3 changed files with 67 additions and 58 deletions

View file

@ -2,7 +2,6 @@
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs, ... }: let
inherit (nixpkgs) lib;
eachSystem = lib.genAttrs [ "x86_64-linux" "aarch64-linux" ];
in {
nixosModules = {
default = import ./module.nix;
@ -11,23 +10,24 @@
};
};
nixosConfigurations = eachSystem (system: lib.nixosSystem {
inherit system;
nixosConfigurations.testEval = lib.nixosSystem {
system = "x86_64-linux";
modules = [ {
system.stateVersion = "24.11";
networking.hostName = "hostName";
networking.domain = "domain";
fileSystems."/".device = "nodev";
boot.loader.grub.enable = false;
services.akkoma.enable = true;
services.akkoma.config.":pleroma".":instance" = {
services.akkoma.config.":pleroma" = {
"Pleroma.Upload".base_url = "nonEmptyStr";
":instance" = {
name = "test";
description = "test";
email = "test@test.test";
};
};
} ] ++ (with self.nixosModules; [ default florp ]);
});
checks = eachSystem (system: {
default = self.nixosConfigurations.${system}.config.system.build.toplevel;
});
};
};
}

View file

@ -1,4 +1,6 @@
{ lib, ... }: {
{ lib, ... }: let
genAction = instances: action: lib.genAttrs instances (_: action);
in {
instances = {
"kiwifarms.*" = {
reason = "Targeted harassment.";
@ -31,7 +33,7 @@
};
}
# Rightwing extremism
// lib.genAttrs [
// genAction [
"brighteon.social"
"detroitriotcity.com"
"freeatlantis.com"
@ -45,7 +47,7 @@
media = "mark";
}
# Lolicon, shotacon
// lib.genAttrs [
// genAction [
"inumimi.love"
"filly.love"
"loli.church"
@ -56,7 +58,7 @@
media = "strip";
}
# CSAM suspects
// lib.genAttrs [
// genAction [
"eepy.express"
"megasugki.xyz"
"minor.cafe"

View file

@ -11,10 +11,11 @@ in {
options.services.akkoma.moderation = {
instances = lib.mkOption {
type = with lib.types; attrsOf (submodule {
options = {
inherit reason;
activities = lib.mkOption {
type = with lib.types; (nullOr enum [ "unlist" "restrict" "reject" ]);
type = with lib.types; (nullOr (enum [ "unlist" "restrict" "reject" "followersOnly" ]));
default = null;
description = ''
Activity moderation:
@ -26,7 +27,7 @@ in {
};
media = lib.mkOption {
type = with lib.types; (nullOr enum [ "mark" "strip" ]);
type = with lib.types; (nullOr (enum [ "mark" "strip" ]));
default = null;
description = ''
Media attachment moderation:
@ -35,6 +36,7 @@ in {
- `strip`: Strip all media attachments.
'';
};
};
});
description = ''
@ -58,6 +60,7 @@ in {
hashtags = lib.mkOption {
type = with lib.types; attrsOf (submodule {
options = {
inherit reason;
sensitive = lib.mkOption {
@ -75,6 +78,8 @@ in {
Remove tagged activities from federated timeline.
'';
};
};
});
description = ''
@ -93,6 +98,7 @@ in {
keywords = lib.mkOption {
type = with lib.types; attrsOf (submodule {
options = {
inherit reason;
action = lib.mkOption {
@ -104,6 +110,7 @@ in {
- `reject`: Reject matching activities.
'';
};
};
});
description = ''