From 5037a45d4113d8b8022a1f85e3bb75243efe1a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20van=20Br=C3=BCgge?= Date: Sun, 29 Dec 2024 15:48:45 +0000 Subject: [PATCH 1/4] tandoor-recipes: add jvanbruegge as maintainer --- nixos/modules/services/misc/tandoor-recipes.nix | 2 +- pkgs/applications/misc/tandoor-recipes/common.nix | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/nixos/modules/services/misc/tandoor-recipes.nix b/nixos/modules/services/misc/tandoor-recipes.nix index 1baa60f9f9cd..3355e4ab98e0 100644 --- a/nixos/modules/services/misc/tandoor-recipes.nix +++ b/nixos/modules/services/misc/tandoor-recipes.nix @@ -31,7 +31,7 @@ let ''; in { - meta.maintainers = with lib.maintainers; [ ]; + meta.maintainers = with lib.maintainers; [ jvanbruegge ]; options.services.tandoor-recipes = { enable = lib.mkOption { diff --git a/pkgs/applications/misc/tandoor-recipes/common.nix b/pkgs/applications/misc/tandoor-recipes/common.nix index 57f687d522e6..75109f6bef59 100644 --- a/pkgs/applications/misc/tandoor-recipes/common.nix +++ b/pkgs/applications/misc/tandoor-recipes/common.nix @@ -14,6 +14,6 @@ rec { meta = with lib; { homepage = "https://tandoor.dev/"; license = licenses.agpl3Only; - maintainers = with maintainers; [ ]; + maintainers = with maintainers; [ jvanbruegge ]; }; } From afc8eddc2547a9a5525421e37a814b83cac33b2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20van=20Br=C3=BCgge?= Date: Sun, 29 Dec 2024 15:58:49 +0000 Subject: [PATCH 2/4] tandoor-recipes: fix build --- .../misc/tandoor-recipes/default.nix | 96 ++++++------------- .../misc/tandoor-recipes/frontend.nix | 6 +- 2 files changed, 33 insertions(+), 69 deletions(-) diff --git a/pkgs/applications/misc/tandoor-recipes/default.nix b/pkgs/applications/misc/tandoor-recipes/default.nix index b6d99325f120..be9e72dd8a57 100644 --- a/pkgs/applications/misc/tandoor-recipes/default.nix +++ b/pkgs/applications/misc/tandoor-recipes/default.nix @@ -1,52 +1,15 @@ { callPackage , nixosTests -, python311 -, fetchFromGitHub +, python3 }: let - # python-ldap-3.4.4 does not work with python3(12) - python = python311.override { - self = python; - packageOverrides = self: super: { - validators = super.validators.overridePythonAttrs (_: rec { - version = "0.20.0"; - src = fetchFromGitHub { - owner = "python-validators"; - repo = "validators"; - rev = version; - hash = "sha256-ZnLyTHlsrXthGnaPzlV2ga/UTm5SSEHLTwC/tobiPak="; - }; - propagatedBuildInputs = [ super.decorator super.six ]; - }); - - djangorestframework = super.djangorestframework.overridePythonAttrs (oldAttrs: rec { - version = "3.14.0"; - src = oldAttrs.src.override { - rev = version; - hash = "sha256-Fnj0n3NS3SetOlwSmGkLE979vNJnYE6i6xwVBslpNz4="; - }; - nativeCheckInputs = with super; [ - pytest7CheckHook - pytest-django - ]; - }); - - # python3.11-extruct-0.16.0 doesn't work with lxml-5.2.2 - lxml = super.lxml.overridePythonAttrs (oldAttrs: rec { - version = "5.1.0"; - src = oldAttrs.src.override { - rev = version; - hash = "sha256-eWLYzZWatYDmhuBTZynsdytlNFKKmtWQ1XIyzVD8sDY="; - }; - }); - }; - }; + python = python3; common = callPackage ./common.nix { }; frontend = callPackage ./frontend.nix { }; in -python.pkgs.pythonPackages.buildPythonPackage rec { +python.pkgs.pythonPackages.buildPythonPackage { pname = "tandoor-recipes"; inherit (common) version src; @@ -62,50 +25,51 @@ python.pkgs.pythonPackages.buildPythonPackage rec { ''; propagatedBuildInputs = with python.pkgs; [ - aiohttp - beautifulsoup4 - bleach - bleach-allowlist - boto3 - cryptography django - django-allauth + cryptography django-annoying - django-auth-ldap django-cleanup - django-cors-headers django-crispy-forms django-crispy-bootstrap4 - django-hcaptcha - django-js-reverse - django-oauth-toolkit - django-prometheus - django-scopes - django-storages django-tables2 - django-webpack-loader - django-treebeard djangorestframework drf-writable-nested + django-oauth-toolkit + bleach gunicorn - icalendar - jinja2 lxml markdown - microdata pillow psycopg2 - pyppeteer python-dotenv - pytube - pyyaml - recipe-scrapers requests six - uritemplate - validators webdavclient3 whitenoise + icalendar + pyyaml + uritemplate + beautifulsoup4 + microdata + jinja2 + django-webpack-loader + django-js-reverse + django-allauth + recipe-scrapers + django-scopes + django-treebeard + django-cors-headers + django-storages + boto3 + django-prometheus + django-hcaptcha + python-ldap + django-auth-ldap + pyppeteer + pytubefix + aiohttp + inflection + redis ]; configurePhase = '' diff --git a/pkgs/applications/misc/tandoor-recipes/frontend.nix b/pkgs/applications/misc/tandoor-recipes/frontend.nix index 0248e5ffbae0..1e0735d15fe7 100644 --- a/pkgs/applications/misc/tandoor-recipes/frontend.nix +++ b/pkgs/applications/misc/tandoor-recipes/frontend.nix @@ -3,7 +3,7 @@ fetchYarnDeps, fixup-yarn-lock, callPackage, - nodejs, + nodejs_20, yarn, }: let @@ -22,8 +22,8 @@ stdenv.mkDerivation { nativeBuildInputs = [ fixup-yarn-lock - nodejs - yarn + nodejs_20 + (yarn.override { nodejs = nodejs_20; }) ]; configurePhase = '' From 2a9a4592271769749c0da32819a6f757e2f821eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20van=20Br=C3=BCgge?= Date: Sun, 29 Dec 2024 15:59:19 +0000 Subject: [PATCH 3/4] tandoor-recipes: fix update script to use nixpkgs root as workdir This is what e.g. ./maintainers/scripts/update.nix expects --- pkgs/applications/misc/tandoor-recipes/update.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/tandoor-recipes/update.sh b/pkgs/applications/misc/tandoor-recipes/update.sh index 63021d76f6b7..f197ead847e4 100755 --- a/pkgs/applications/misc/tandoor-recipes/update.sh +++ b/pkgs/applications/misc/tandoor-recipes/update.sh @@ -1,5 +1,5 @@ #!/usr/bin/env nix-shell -#!nix-shell -I nixpkgs=../../../../ -i bash -p nix wget prefetch-yarn-deps nix-prefetch-github jq +#!nix-shell -I nixpkgs=./ -i bash -p nix wget prefetch-yarn-deps nix-prefetch-github jq # shellcheck shell=bash @@ -36,6 +36,7 @@ popd # Use friendlier hashes yarn_hash=$(nix hash to-sri --type sha256 "$yarn_hash") -sed -i -E -e "s#version = \".*\"#version = \"$version\"#" common.nix -sed -i -E -e "s#hash = \".*\"#hash = \"$src_hash\"#" common.nix -sed -i -E -e "s#yarnHash = \".*\"#yarnHash = \"$yarn_hash\"#" common.nix +common="./pkgs/applications/misc/tandoor-recipes/common.nix" +sed -i -E -e "s#version = \".*\"#version = \"$version\"#" $common +sed -i -E -e "s#hash = \".*\"#hash = \"$src_hash\"#" $common +sed -i -E -e "s#yarnHash = \".*\"#yarnHash = \"$yarn_hash\"#" $common From b36c4cd2261db2e718c988e8a3a41cc96ad8b2c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20van=20Br=C3=BCgge?= Date: Sun, 29 Dec 2024 16:14:40 +0000 Subject: [PATCH 4/4] tandoor-recipes: 1.5.19 -> 1.5.25 --- pkgs/applications/misc/tandoor-recipes/common.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/tandoor-recipes/common.nix b/pkgs/applications/misc/tandoor-recipes/common.nix index 75109f6bef59..b0a3dbf1e7e9 100644 --- a/pkgs/applications/misc/tandoor-recipes/common.nix +++ b/pkgs/applications/misc/tandoor-recipes/common.nix @@ -1,15 +1,15 @@ { lib, fetchFromGitHub }: rec { - version = "1.5.19"; + version = "1.5.25"; src = fetchFromGitHub { owner = "TandoorRecipes"; repo = "recipes"; rev = version; - hash = "sha256-HsBy2HzxBpnwh2RqFQJG0HYReWI0a7E7KsJ5TD+GokY="; + hash = "sha256-Yw68wxLqoyPRQmP/krSaxByv24CKh7Y7O07NU+dL5mo="; }; - yarnHash = "sha256-BnOw9QRXRRoM+CW6OGbjWhLo4h6JX3ZR1kJd8Z/w02M="; + yarnHash = "sha256-lU8QrTkI32XOHefIkj/0fa2UKhuZpQIT1wyweQnzXmQ="; meta = with lib; { homepage = "https://tandoor.dev/";