1
0
Fork 0

Don‘t load mastodon_digest

This commit is contained in:
Malte 2023-01-16 00:30:51 +01:00
parent c5c4d4aba7
commit 86fc179daa
3 changed files with 47 additions and 6 deletions

View file

@ -11,12 +11,6 @@
"url": "https://github.com/srid/emanote/archive/584d52c4c7071e643ce738db9db0196f17071518.tar.gz",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
},
"mastodon_digest": {
"branch": "main",
"repo": "git@hera.m-0.eu:mastodon_digest",
"rev": "abea31381316d762d3c8eecc6f732eb6620e259e",
"type": "git"
},
"hexa-nur-packages": {
"branch": "master",
"description": "My personal NUR repository: [maintainer=@mweinelt] ",

View file

@ -0,0 +1,13 @@
diff --git a/thresholds.py b/thresholds.py
index 8d7f114..0802ff6 100644
--- a/thresholds.py
+++ b/thresholds.py
@@ -11,8 +11,6 @@ if TYPE_CHECKING:
class Threshold(Enum):
- ALL = 0
- HALF = 50
LAX = 90
NORMAL = 95
STRICT = 98

View file

@ -0,0 +1,34 @@
final: prev: let
pkgs = final;
deps = ps:
with ps; [
jinja2
mastodon-py
scipy
python-dotenv
];
python-env = pkgs.python3.withPackages deps;
src = pkgs.fetchFromGitHub {
owner = "hodgesmr";
repo = "mastodon_digest";
rev = "07d8827a79086263f0e0f161faa2c12e405b2929";
hash = "sha256-iFOvexzj5UQve67nvNcGthrvVbL5yQbYyUIXlaRYlug=";
};
patchedSrc = pkgs.runCommand "mastodon_digest-patched-src" '' { }
cp -r ${src} $out
chmod -R +w $out
patch -d $out -p1 < ${./all-posts.patch}
'';
in {
mastodon_digest = pkgs.writeShellApplication {
name = "mastodon_digest";
runtimeInputs = [python-env];
text = ''
set -o allexport
# shellcheck source=/dev/null
source .env
set +o allexport
cd ${patchedSrc} && python run.py "''${@}"
'';
};
}