gerd.wger: init
This commit is contained in:
parent
80ef4fabc8
commit
2f2993ac16
16 changed files with 733 additions and 0 deletions
|
@ -19,6 +19,7 @@
|
||||||
./gerd/services/cyberchef.nix
|
./gerd/services/cyberchef.nix
|
||||||
./gerd/services/nextcloud.nix
|
./gerd/services/nextcloud.nix
|
||||||
./gerd/services/stalwart
|
./gerd/services/stalwart
|
||||||
|
./gerd/services/wger
|
||||||
|
|
||||||
./gerd/services/element.nix
|
./gerd/services/element.nix
|
||||||
./gerd/services/matrix-synapse.nix
|
./gerd/services/matrix-synapse.nix
|
||||||
|
@ -43,6 +44,7 @@
|
||||||
"safe/svcs/nextcloud" = { mountpoint = "/srv/nextcloud"; extra.options.quota = "5G"; };
|
"safe/svcs/nextcloud" = { mountpoint = "/srv/nextcloud"; extra.options.quota = "5G"; };
|
||||||
"safe/svcs/stalwart" = { mountpoint = "/srv/stalwart"; extra.options.quota = "5G"; };
|
"safe/svcs/stalwart" = { mountpoint = "/srv/stalwart"; extra.options.quota = "5G"; };
|
||||||
"safe/svcs/synapse" = { mountpoint = "/srv/synapse"; extra.options.quota = "5G"; };
|
"safe/svcs/synapse" = { mountpoint = "/srv/synapse"; extra.options.quota = "5G"; };
|
||||||
|
"safe/svcs/wger" = { mountpoint = "/srv/wger"; extra.options.quota = "5G"; };
|
||||||
"safe/svcs/postgresql" = { mountpoint = "/srv/postgresql"; extra.options.quota = "5G"; };
|
"safe/svcs/postgresql" = { mountpoint = "/srv/postgresql"; extra.options.quota = "5G"; };
|
||||||
"backup/postgresql" = { mountpoint = "/media/backup/postgresqlbackup"; extra.options.quota = "5G"; };
|
"backup/postgresql" = { mountpoint = "/media/backup/postgresqlbackup"; extra.options.quota = "5G"; };
|
||||||
};
|
};
|
||||||
|
|
149
machines/gerd/services/wger/default.nix
Normal file
149
machines/gerd/services/wger/default.nix
Normal file
|
@ -0,0 +1,149 @@
|
||||||
|
{ config, pkgs, ... }:
|
||||||
|
|
||||||
|
let
|
||||||
|
svc_domain = "wger.${config.mine.shared.settings.domain}";
|
||||||
|
port = 8000;
|
||||||
|
wger_user = "wger";
|
||||||
|
statedir = config.mine.zfsMounts."rpool/safe/svcs/wger";
|
||||||
|
|
||||||
|
wgerpkgs = pkgs.callPackage ./wgerpkg/default.nix {};
|
||||||
|
|
||||||
|
# # Application settings
|
||||||
|
# WGER_SETTINGS['EMAIL_FROM'] = 'wger Workout Manager <wger@example.com>'
|
||||||
|
# WGER_SETTINGS["ALLOW_REGISTRATION"] = True
|
||||||
|
# WGER_SETTINGS["ALLOW_GUEST_USERS"] = True
|
||||||
|
# WGER_SETTINGS["ALLOW_UPLOAD_VIDEOS"] = False
|
||||||
|
# WGER_SETTINGS["MIN_ACCOUNT_AGE_TO_TRUST"] = 21 # in days
|
||||||
|
# WGER_SETTINGS["EXERCISE_CACHE_TTL"] = 3600 # in seconds
|
||||||
|
wger_settings = {
|
||||||
|
EMAIL_FROM = "wger Workout Manager <wger@example.com>";
|
||||||
|
ALLOW_REGISTRATION = true;
|
||||||
|
ALLOW_GUEST_USERS = true;
|
||||||
|
ALLOW_UPLOAD_VIDEOS = false;
|
||||||
|
MIN_ACCOUNT_AGE_TO_TRUST = 21;
|
||||||
|
EXERCISE_CACHE_TTL = 3600;
|
||||||
|
};
|
||||||
|
|
||||||
|
django_settings = rec {
|
||||||
|
DEBUG = true;
|
||||||
|
DATABASES.default = {
|
||||||
|
# ENGINE = "django.db.backends.sqlite3";
|
||||||
|
# NAME = "${statedir}/database.sqlite";
|
||||||
|
# USER = "";
|
||||||
|
# PASSWORD = "";
|
||||||
|
# HOST = "";
|
||||||
|
# PORT = "";
|
||||||
|
ENGINE = "django.db.backends.postgresql";
|
||||||
|
NAME = "wger";
|
||||||
|
USER = "wger";
|
||||||
|
PASSWORD = "";
|
||||||
|
HOST = "/run/postgresql";
|
||||||
|
PORT = "";
|
||||||
|
};
|
||||||
|
|
||||||
|
ADMINS = [["Your Name" "test@test.dk"]];
|
||||||
|
MANAGERS = ADMINS;
|
||||||
|
|
||||||
|
TIME_ZONE = "Europe/Berlin";
|
||||||
|
|
||||||
|
SECRET_KEY = "2w!yl6ausb-$05#mjnec)g_h#nc9pzzw0c(kvaskocvyyg1oqc";
|
||||||
|
|
||||||
|
SITE_URL = "http://localhost:8100";
|
||||||
|
|
||||||
|
MEDIA_ROOT = "${statedir}/media";
|
||||||
|
MEDIA_URL = "/media/";
|
||||||
|
|
||||||
|
EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend";
|
||||||
|
|
||||||
|
# DEFAULT_FROM_EMAIL = WGER_SETTINGS['EMAIL_FROM']
|
||||||
|
|
||||||
|
EMAIL_PAGE_DOMAIN = SITE_URL;
|
||||||
|
|
||||||
|
CSRF_TRUSTED_ORIGINS = [ "https://${svc_domain}" ];
|
||||||
|
ALLOWED_HOSTS = [ svc_domain ];
|
||||||
|
|
||||||
|
RECAPTCHA_PUBLIC_KEY = "";
|
||||||
|
RECAPTCHA_PRIVATE_KEY = "";
|
||||||
|
USE_RECAPTCHA = false;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
wger_settings_file = pkgs.writeText "settings.json" (builtins.toJSON wger_settings);
|
||||||
|
django_settings_file = pkgs.writeText "settings.json" (builtins.toJSON django_settings);
|
||||||
|
settingsFile = pkgs.writeText "settings.py" ''
|
||||||
|
from wger.settings_global import *
|
||||||
|
import json
|
||||||
|
|
||||||
|
with open("${django_settings_file}") as f:
|
||||||
|
globals().update(json.load(f))
|
||||||
|
|
||||||
|
with open("${wger_settings_file}") as f:
|
||||||
|
WGER_SETTINGS.update(json.load(f))
|
||||||
|
'';
|
||||||
|
in {
|
||||||
|
|
||||||
|
systemd.services.wger = {
|
||||||
|
description = "wger fitness";
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
after = [ "networking.target" ];
|
||||||
|
script = ''
|
||||||
|
# general wger things
|
||||||
|
${wgerpkgs}/bin/wger migrate-db -s ${settingsFile} || true
|
||||||
|
# ${wgerpkgs}/bin/wger load-fixtures -s ${settingsFile} || true
|
||||||
|
# ${wgerpkgs}/bin/wger load-online-fixtures -s ${settingsFile} || true
|
||||||
|
|
||||||
|
# manage things
|
||||||
|
# WGER_SETTINGS=${settingsFile} ${wgerpkgs}/bin/manage download-exercise-images || true
|
||||||
|
# WGER_SETTINGS=${settingsFile} ${wgerpkgs}/bin/manage download-exercise-videos || true
|
||||||
|
# WGER_SETTINGS=${settingsFile} ${wgerpkgs}/bin/manage download-ingredient-images || true
|
||||||
|
WGER_SETTINGS=${settingsFile} ${wgerpkgs}/bin/manage sync-exercises || true
|
||||||
|
# WGER_SETTINGS=${settingsFile} ${wgerpkgs}/bin/manage sync-ingredients || true
|
||||||
|
WGER_SETTINGS=${settingsFile} ${wgerpkgs}/bin/manage exercises-health-check || true
|
||||||
|
|
||||||
|
# run server
|
||||||
|
${wgerpkgs}/bin/wger start -s ${settingsFile}
|
||||||
|
'';
|
||||||
|
|
||||||
|
serviceConfig = {
|
||||||
|
User = "wger";
|
||||||
|
Group = "wger";
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
users.users."${wger_user}"= {
|
||||||
|
uid = 738;
|
||||||
|
isSystemUser = true;
|
||||||
|
group = wger_user;
|
||||||
|
|
||||||
|
};
|
||||||
|
users.groups."${wger_user}".gid = 738;
|
||||||
|
|
||||||
|
services.postgresql = {
|
||||||
|
ensureDatabases = [ wger_user ];
|
||||||
|
ensureUsers = [{
|
||||||
|
name = wger_user;
|
||||||
|
ensureDBOwnership = true;
|
||||||
|
}];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
services.nginx.virtualHosts."${svc_domain}" = {
|
||||||
|
forceSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
|
||||||
|
extraConfig = ''
|
||||||
|
include ${config.mine.shared.lib.authelia.autheliaLocation};
|
||||||
|
'';
|
||||||
|
|
||||||
|
locations."/" = config.mine.shared.lib.authelia.mkProtectedLocation {
|
||||||
|
proxyPass = "http://localhost:${builtins.toString port}";
|
||||||
|
};
|
||||||
|
locations."/api/v2/register" = config.mine.shared.lib.authelia.mkProtectedLocation {
|
||||||
|
proxyPass = "http://localhost:${builtins.toString port}";
|
||||||
|
};
|
||||||
|
|
||||||
|
locations."/static".proxyPass = "http://localhost:${builtins.toString port}";
|
||||||
|
locations."/media".proxyPass = "http://localhost:${builtins.toString port}";
|
||||||
|
locations."/api".proxyPass = "http://localhost:${builtins.toString port}";
|
||||||
|
};
|
||||||
|
}
|
1
machines/gerd/services/wger/wgerpkg/.#settings.nix
Symbolic link
1
machines/gerd/services/wger/wgerpkg/.#settings.nix
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
eyjhb@chronos.625709:1733150131
|
1
machines/gerd/services/wger/wgerpkg/.#settings.py
Symbolic link
1
machines/gerd/services/wger/wgerpkg/.#settings.py
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
eyjhb@chronos.625709:1733150131
|
97
machines/gerd/services/wger/wgerpkg/default.nix
Normal file
97
machines/gerd/services/wger/wgerpkg/default.nix
Normal file
|
@ -0,0 +1,97 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
python3,
|
||||||
|
fetchFromGitHub,
|
||||||
|
callPackage,
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
frontend = callPackage ./frontend.nix {};
|
||||||
|
in python3.pkgs.buildPythonApplication rec {
|
||||||
|
pname = "wger";
|
||||||
|
version = "unstable";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "wger-project";
|
||||||
|
repo = "wger";
|
||||||
|
rev = "bfca74e88f6c9ff6e917e0ba0e8e9c782ae0047b";
|
||||||
|
hash = "sha256-VuVKgkNp6Omiag72lOn6p51kC/jvApX/kRAPpK95U7w=";
|
||||||
|
};
|
||||||
|
|
||||||
|
build-system = [
|
||||||
|
python3.pkgs.hatchling
|
||||||
|
];
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
./patches/pyproject.patch
|
||||||
|
./patches/tasks.patch
|
||||||
|
./patches/manage.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
# dependencies = with python3.pkgs; [
|
||||||
|
propagatedBuildInputs = with python3.pkgs; [
|
||||||
|
bleach
|
||||||
|
celery
|
||||||
|
django-crispy-bootstrap5
|
||||||
|
django
|
||||||
|
# django-activity-stream
|
||||||
|
(python3.pkgs.callPackage ./django-activity-stream.nix {})
|
||||||
|
django-axes
|
||||||
|
django-compressor
|
||||||
|
django-cors-headers
|
||||||
|
django-crispy-forms
|
||||||
|
# django-email-verification
|
||||||
|
(python3.pkgs.callPackage ./django-email-verification.nix {})
|
||||||
|
django-environ
|
||||||
|
django-filter
|
||||||
|
django-formtools
|
||||||
|
django-prometheus
|
||||||
|
# django-recaptcha
|
||||||
|
(python3.pkgs.callPackage ./django-recaptcha.nix {})
|
||||||
|
django-simple-history
|
||||||
|
# django-sortedm2m
|
||||||
|
(python3.pkgs.callPackage ./django-sortedm2m.nix {})
|
||||||
|
django-storages
|
||||||
|
djangorestframework
|
||||||
|
djangorestframework-simplejwt
|
||||||
|
drf-spectacular
|
||||||
|
easy-thumbnails
|
||||||
|
flower
|
||||||
|
fontawesomefree
|
||||||
|
icalendar
|
||||||
|
invoke
|
||||||
|
# openfoodfacts
|
||||||
|
(python3.pkgs.callPackage ./openfoodfacts.nix {})
|
||||||
|
pillow
|
||||||
|
reportlab
|
||||||
|
requests
|
||||||
|
tqdm
|
||||||
|
tzdata
|
||||||
|
|
||||||
|
# extra??
|
||||||
|
drf-spectacular-sidecar
|
||||||
|
(python3.pkgs.callPackage ./django-bootstrap-breadcrumbs.nix {})
|
||||||
|
psycopg2
|
||||||
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
cp manage.py wger/manage.py
|
||||||
|
'';
|
||||||
|
|
||||||
|
postInstall = ''
|
||||||
|
cp -a ${frontend}/static/yarn $out/${python3.sitePackages}/wger/core/static
|
||||||
|
'';
|
||||||
|
|
||||||
|
pythonImportsCheck = [
|
||||||
|
"wger"
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "";
|
||||||
|
homepage = "https://github.com/wger-project/wger";
|
||||||
|
license = lib.licenses.agpl3Only;
|
||||||
|
maintainers = with lib.maintainers; [ eyjhb ];
|
||||||
|
mainProgram = "wger";
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,43 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildPythonPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
setuptools,
|
||||||
|
wheel,
|
||||||
|
django,
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "django-activity-stream";
|
||||||
|
version = "2.0.0";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "justquick";
|
||||||
|
repo = "django-activity-stream";
|
||||||
|
rev = version;
|
||||||
|
hash = "sha256-fZrZDCWBFx1R9GGcTkjos7blSBNx1JTdTIVLKz+E2+c=";
|
||||||
|
};
|
||||||
|
|
||||||
|
build-system = [
|
||||||
|
setuptools
|
||||||
|
wheel
|
||||||
|
];
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
django
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonImportsCheck = [
|
||||||
|
# "django_activity_stream"
|
||||||
|
"actstream"
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Generate generic activity streams from the actions on your site. Users can follow any actors' activities for personalized streams";
|
||||||
|
homepage = "https://github.com/justquick/django-activity-stream";
|
||||||
|
changelog = "https://github.com/justquick/django-activity-stream/blob/${src.rev}/CHANGELOG.rst";
|
||||||
|
license = lib.licenses.bsd3;
|
||||||
|
maintainers = with lib.maintainers; [ ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildPythonPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
setuptools,
|
||||||
|
wheel,
|
||||||
|
django,
|
||||||
|
six,
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "bootstrap-breadcrumbs";
|
||||||
|
version = "0.9.2";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "prymitive";
|
||||||
|
repo = "bootstrap-breadcrumbs";
|
||||||
|
rev = version;
|
||||||
|
hash = "sha256-w6s3LL/skzz4EnWtdsa5GXeISrJzr4yQ8hm/gQMva1o=";
|
||||||
|
};
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
./patches/breadcrumbs.patch
|
||||||
|
];
|
||||||
|
|
||||||
|
build-system = [
|
||||||
|
setuptools
|
||||||
|
wheel
|
||||||
|
];
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
django
|
||||||
|
six
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonImportsCheck = [
|
||||||
|
# "bootstrap_breadcrumbs"
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Django template tags for easy breadcrumbs using twitter bootstrap css classes or custom template";
|
||||||
|
homepage = "https://github.com/prymitive/bootstrap-breadcrumbs";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
maintainers = with lib.maintainers; [ ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,63 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildPythonPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
setuptools,
|
||||||
|
wheel,
|
||||||
|
asgiref,
|
||||||
|
coverage,
|
||||||
|
deprecation,
|
||||||
|
django,
|
||||||
|
iniconfig,
|
||||||
|
packaging,
|
||||||
|
pluggy,
|
||||||
|
pyjwt,
|
||||||
|
pytest,
|
||||||
|
pytest-django,
|
||||||
|
sqlparse,
|
||||||
|
validators,
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "django-email-verification";
|
||||||
|
version = "unstable-2024-07-12";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "LeoneBacciu";
|
||||||
|
repo = "django-email-verification";
|
||||||
|
rev = "49e841b96e8bd39f0ad359a75be4711508ac4879";
|
||||||
|
hash = "sha256-4hMSA1d6GOu7Xo7Qq1tBob4lW2zq1E4YaD8w0BnFfVc=";
|
||||||
|
};
|
||||||
|
|
||||||
|
build-system = [
|
||||||
|
setuptools
|
||||||
|
wheel
|
||||||
|
];
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
asgiref
|
||||||
|
coverage
|
||||||
|
deprecation
|
||||||
|
django
|
||||||
|
iniconfig
|
||||||
|
packaging
|
||||||
|
pluggy
|
||||||
|
pyjwt
|
||||||
|
pytest
|
||||||
|
pytest-django
|
||||||
|
sqlparse
|
||||||
|
validators
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonImportsCheck = [
|
||||||
|
# "django_email_verification"
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "A Django app that takes care of verifying a users's email address and activating their profile";
|
||||||
|
homepage = "https://github.com/LeoneBacciu/django-email-verification";
|
||||||
|
license = lib.licenses.mit;
|
||||||
|
maintainers = with lib.maintainers; [ ];
|
||||||
|
};
|
||||||
|
}
|
46
machines/gerd/services/wger/wgerpkg/django-recaptcha.nix
Normal file
46
machines/gerd/services/wger/wgerpkg/django-recaptcha.nix
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildPythonPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
setuptools,
|
||||||
|
wheel,
|
||||||
|
django,
|
||||||
|
coveralls,
|
||||||
|
tox,
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "django-recaptcha";
|
||||||
|
version = "4.0.0";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "django-recaptcha";
|
||||||
|
repo = "django-recaptcha";
|
||||||
|
rev = version;
|
||||||
|
hash = "sha256-B6Z9oKcMjSh+zE28k0ipoBppm9dD+Moa+PAZqXVabpA=";
|
||||||
|
};
|
||||||
|
|
||||||
|
build-system = [
|
||||||
|
setuptools
|
||||||
|
wheel
|
||||||
|
];
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
django
|
||||||
|
coveralls
|
||||||
|
tox
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonImportsCheck = [
|
||||||
|
# "django_recaptcha"
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Django reCAPTCHA form field/widget integration app";
|
||||||
|
homepage = "https://github.com/django-recaptcha/django-recaptcha";
|
||||||
|
changelog = "https://github.com/django-recaptcha/django-recaptcha/blob/${src.rev}/CHANGELOG.md";
|
||||||
|
license = lib.licenses.bsd3;
|
||||||
|
maintainers = with lib.maintainers; [ ];
|
||||||
|
};
|
||||||
|
}
|
49
machines/gerd/services/wger/wgerpkg/django-sortedm2m.nix
Normal file
49
machines/gerd/services/wger/wgerpkg/django-sortedm2m.nix
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildPythonPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
setuptools,
|
||||||
|
wheel,
|
||||||
|
coverage,
|
||||||
|
isort,
|
||||||
|
pycodestyle,
|
||||||
|
pylint-django,
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "django-sortedm2m";
|
||||||
|
version = "4.0.0";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "jazzband";
|
||||||
|
repo = "django-sortedm2m";
|
||||||
|
rev = version;
|
||||||
|
hash = "sha256-Jr3C6teU4On2PiJJV9vW4EEPEuknNCZRVMDMmrs6VY8=";
|
||||||
|
};
|
||||||
|
|
||||||
|
build-system = [
|
||||||
|
setuptools
|
||||||
|
wheel
|
||||||
|
];
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
coverage
|
||||||
|
isort
|
||||||
|
pycodestyle
|
||||||
|
pylint-django
|
||||||
|
setuptools
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonImportsCheck = [
|
||||||
|
# "django_sortedm2m"
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "A transparent sorted ManyToMany field for django";
|
||||||
|
homepage = "https://github.com/jazzband/django-sortedm2m";
|
||||||
|
changelog = "https://github.com/jazzband/django-sortedm2m/blob/${src.rev}/CHANGES.rst";
|
||||||
|
license = lib.licenses.bsd3;
|
||||||
|
maintainers = with lib.maintainers; [ ];
|
||||||
|
};
|
||||||
|
}
|
63
machines/gerd/services/wger/wgerpkg/frontend.nix
Normal file
63
machines/gerd/services/wger/wgerpkg/frontend.nix
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
python3,
|
||||||
|
fetchFromGitHub,
|
||||||
|
mkYarnPackage,
|
||||||
|
fetchYarnDeps,
|
||||||
|
sass,
|
||||||
|
stdenv,
|
||||||
|
yarn,
|
||||||
|
fixup-yarn-lock,
|
||||||
|
}:
|
||||||
|
|
||||||
|
let
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "wger-project";
|
||||||
|
repo = "wger";
|
||||||
|
rev = "bfca74e88f6c9ff6e917e0ba0e8e9c782ae0047b";
|
||||||
|
hash = "sha256-VuVKgkNp6Omiag72lOn6p51kC/jvApX/kRAPpK95U7w=";
|
||||||
|
};
|
||||||
|
|
||||||
|
offlineCache = fetchYarnDeps {
|
||||||
|
yarnLock = "${src}/yarn.lock";
|
||||||
|
hash = "sha256-olRU6ZGh6bpZ/WfwIKeREJRGd3oo7kEffFx8+4+7s5k=";
|
||||||
|
};
|
||||||
|
in
|
||||||
|
stdenv.mkDerivation {
|
||||||
|
pname = "tetrio-plus";
|
||||||
|
version = "1.0.0";
|
||||||
|
|
||||||
|
src = src;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
yarn
|
||||||
|
fixup-yarn-lock
|
||||||
|
sass
|
||||||
|
];
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
export HOME=$(mktemp -d)
|
||||||
|
|
||||||
|
yarn config --offline set yarn-offline-mirror ${offlineCache}
|
||||||
|
fixup-yarn-lock yarn.lock
|
||||||
|
yarn install --offline --frozen-lockfile --ignore-platform --ignore-scripts --no-progress --non-interactive
|
||||||
|
|
||||||
|
sass wger/core/static/scss/main.scss wger/core/static/yarn/bootstrap-compiled.css
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out
|
||||||
|
cp -a wger/core/static $out/static
|
||||||
|
'';
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "";
|
||||||
|
homepage = "https://github.com/wger-project/wger";
|
||||||
|
license = lib.licenses.agpl3Only;
|
||||||
|
maintainers = with lib.maintainers; [ ];
|
||||||
|
mainProgram = "wger";
|
||||||
|
};
|
||||||
|
}
|
55
machines/gerd/services/wger/wgerpkg/openfoodfacts.nix
Normal file
55
machines/gerd/services/wger/wgerpkg/openfoodfacts.nix
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
{
|
||||||
|
lib,
|
||||||
|
buildPythonPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
poetry-core,
|
||||||
|
pydantic,
|
||||||
|
requests,
|
||||||
|
tqdm,
|
||||||
|
pillow,
|
||||||
|
redis,
|
||||||
|
}:
|
||||||
|
|
||||||
|
buildPythonPackage rec {
|
||||||
|
pname = "openfoodfacts-python";
|
||||||
|
version = "2.2.0";
|
||||||
|
pyproject = true;
|
||||||
|
|
||||||
|
src = fetchFromGitHub {
|
||||||
|
owner = "openfoodfacts";
|
||||||
|
repo = "openfoodfacts-python";
|
||||||
|
rev = "v${version}";
|
||||||
|
hash = "sha256-aG+zbFr7lhh5OCdPe7h2XJSwok7sdrnpsEBzPgJ6Bas=";
|
||||||
|
};
|
||||||
|
|
||||||
|
build-system = [
|
||||||
|
poetry-core
|
||||||
|
];
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
pydantic
|
||||||
|
requests
|
||||||
|
tqdm
|
||||||
|
];
|
||||||
|
|
||||||
|
optional-dependencies = {
|
||||||
|
Pillow = [
|
||||||
|
pillow
|
||||||
|
];
|
||||||
|
redis = [
|
||||||
|
redis
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
pythonImportsCheck = [
|
||||||
|
"openfoodfacts"
|
||||||
|
];
|
||||||
|
|
||||||
|
meta = {
|
||||||
|
description = "Python package for Open Food Facts";
|
||||||
|
homepage = "https://github.com/openfoodfacts/openfoodfacts-python";
|
||||||
|
changelog = "https://github.com/openfoodfacts/openfoodfacts-python/blob/${src.rev}/CHANGELOG.md";
|
||||||
|
license = with lib.licenses; [ mit asl20 ];
|
||||||
|
maintainers = with lib.maintainers; [ ];
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
diff --git a/django_bootstrap_breadcrumbs/templatetags/django_bootstrap_breadcrumbs.py b/django_bootstrap_breadcrumbs/templatetags/django_bootstrap_breadcrumbs.py
|
||||||
|
index 0e98c65..4a4c13e 100644
|
||||||
|
--- a/django_bootstrap_breadcrumbs/templatetags/django_bootstrap_breadcrumbs.py
|
||||||
|
+++ b/django_bootstrap_breadcrumbs/templatetags/django_bootstrap_breadcrumbs.py
|
||||||
|
@@ -12,7 +12,7 @@ from inspect import ismethod
|
||||||
|
|
||||||
|
from django.utils.html import escape
|
||||||
|
from django.utils.safestring import mark_safe
|
||||||
|
-from django.utils.encoding import smart_text
|
||||||
|
+from django.utils.encoding import smart_str
|
||||||
|
from django.db.models import Model
|
||||||
|
from django.conf import settings
|
||||||
|
from django import template, VERSION
|
||||||
|
@@ -148,7 +148,7 @@ def render_breadcrumbs(context, *args):
|
||||||
|
kwargs=view_kwargs, current_app=current_app)
|
||||||
|
except NoReverseMatch:
|
||||||
|
url = viewname
|
||||||
|
- links.append((url, smart_text(label) if label else label))
|
||||||
|
+ links.append((url, smart_str(label) if label else label))
|
||||||
|
|
||||||
|
if not links:
|
||||||
|
return ''
|
36
machines/gerd/services/wger/wgerpkg/patches/manage.patch
Normal file
36
machines/gerd/services/wger/wgerpkg/patches/manage.patch
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
diff --git a/manage.py b/manage.py
|
||||||
|
index 873291be6..368de89fe 100644
|
||||||
|
--- a/manage.py
|
||||||
|
+++ b/manage.py
|
||||||
|
@@ -2,6 +2,7 @@
|
||||||
|
|
||||||
|
# Standard Library
|
||||||
|
import sys
|
||||||
|
+import os
|
||||||
|
|
||||||
|
# Django
|
||||||
|
from django.core.management import execute_from_command_line
|
||||||
|
@@ -12,13 +13,20 @@ from wger.tasks import (
|
||||||
|
setup_django_environment,
|
||||||
|
)
|
||||||
|
|
||||||
|
-
|
||||||
|
-if __name__ == '__main__':
|
||||||
|
+def main():
|
||||||
|
# If user passed the settings flag ignore the default wger settings
|
||||||
|
- if not any('--settings' in s for s in sys.argv):
|
||||||
|
+ settings_file = os.getenv("WGER_SETTINGS")
|
||||||
|
+
|
||||||
|
+ if not any('--settings' in s for s in sys.argv) and not settings_file:
|
||||||
|
setup_django_environment(get_path('settings.py'))
|
||||||
|
|
||||||
|
+ if settings_file:
|
||||||
|
+ setup_django_environment(get_path(settings_file))
|
||||||
|
+
|
||||||
|
# Alternative to above
|
||||||
|
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
|
||||||
|
|
||||||
|
execute_from_command_line(sys.argv)
|
||||||
|
+
|
||||||
|
+if __name__ == '__main__':
|
||||||
|
+ main()
|
24
machines/gerd/services/wger/wgerpkg/patches/pyproject.patch
Normal file
24
machines/gerd/services/wger/wgerpkg/patches/pyproject.patch
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
diff --git a/pyproject.toml b/pyproject.toml
|
||||||
|
index f10460b1e..62377bd9c 100644
|
||||||
|
--- a/pyproject.toml
|
||||||
|
+++ b/pyproject.toml
|
||||||
|
@@ -35,7 +35,8 @@ Issues = "https://github.com/wger-project/wger/issues"
|
||||||
|
Changelog = "https://wger.readthedocs.io/en/latest/changelog.html"
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
-wger = "wger.__main__:main"
|
||||||
|
+wger = "wger.tasks:main"
|
||||||
|
+manage = "wger.manage:main"
|
||||||
|
|
||||||
|
[tool.setuptools]
|
||||||
|
include-package-data = false
|
||||||
|
@@ -47,6 +48,9 @@ dependencies = { file = ["requirements.txt"] }
|
||||||
|
[tool.distutils.bdist_wheel]
|
||||||
|
universal = 1
|
||||||
|
|
||||||
|
+[tool.hatch.build.targets.wheel.force-include]
|
||||||
|
+"wger/settings_global.py" = "wger/settings_global.py"
|
||||||
|
+
|
||||||
|
|
||||||
|
[tool.ruff]
|
||||||
|
# Exclude a variety of commonly ignored directories.
|
35
machines/gerd/services/wger/wgerpkg/patches/tasks.patch
Normal file
35
machines/gerd/services/wger/wgerpkg/patches/tasks.patch
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
diff --git a/wger/tasks.py b/wger/tasks.py
|
||||||
|
index b1b4b7c65..50bf95b7c 100644
|
||||||
|
--- a/wger/tasks.py
|
||||||
|
+++ b/wger/tasks.py
|
||||||
|
@@ -31,7 +31,7 @@ from django.utils.crypto import get_random_string
|
||||||
|
|
||||||
|
# Third Party
|
||||||
|
import requests
|
||||||
|
-from invoke import task
|
||||||
|
+from invoke import task, Program, Collection
|
||||||
|
from tqdm import tqdm
|
||||||
|
|
||||||
|
|
||||||
|
@@ -358,3 +358,20 @@ def database_exists():
|
||||||
|
sys.exit(0)
|
||||||
|
else:
|
||||||
|
return True
|
||||||
|
+
|
||||||
|
+def main():
|
||||||
|
+ ns = Collection(
|
||||||
|
+ start,
|
||||||
|
+ bootstrap,
|
||||||
|
+ create_settings,
|
||||||
|
+ create_or_reset_admin,
|
||||||
|
+ migrate_db,
|
||||||
|
+ load_fixtures,
|
||||||
|
+ load_online_fixtures,
|
||||||
|
+ )
|
||||||
|
+ program = Program(namespace=ns)
|
||||||
|
+ program.run()
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+if __name__ == "__main__":
|
||||||
|
+ main()
|
||||||
|
|
Loading…
Reference in a new issue