Skip to content

Commit

Permalink
linkding: init at 1.36.0
Browse files Browse the repository at this point in the history
Helps with #341665.

Co-authored-by: Pol Dellaiera <[email protected]>
Co-authored-by: Arne Keller <[email protected]>
  • Loading branch information
3 people committed Jan 11, 2025
1 parent 62ddd9a commit ee0916a
Showing 1 changed file with 134 additions and 0 deletions.
134 changes: 134 additions & 0 deletions pkgs/by-name/li/linkding/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
fetchFromGitHub,
fetchNpmDeps,
lib,
nix-update-script,
nixosTests,
nodejs,
npmHooks,
pkgs,
playwright-driver,
python3Packages,
stdenvNoCC,
uwsgi,
}:
let
pname = "linkding";
version = "1.36.0";

src = fetchFromGitHub {
owner = "sissbruecker";
repo = "linkding";
tag = "v${version}";
hash = "sha256-AePxd7uc1DvMwzhWluYIzXnFDlH/kiWNjBMzj/p68Mk=";
};
npmDeps = fetchNpmDeps {
inherit src;
name = "${pname}-npm-deps";
hash = "sha256-BA7PurUcB5glgaBIpuZLPRSg3GDdi4CLniUjoa/32yc=";
};

in
python3Packages.buildPythonApplication {
inherit
npmDeps
pname
src
version
;

build-system = [
python3Packages.setuptools
];

dependencies = [
python3Packages.asgiref
python3Packages.beautifulsoup4
python3Packages.bleach
python3Packages.bleach-allowlist
python3Packages.certifi
python3Packages.cffi
python3Packages.charset-normalizer
python3Packages.click
python3Packages.confusable-homoglyphs
python3Packages.cryptography
python3Packages.django
python3Packages.django-registration
python3Packages.django-widget-tweaks
python3Packages.djangorestframework
python3Packages.huey
python3Packages.idna
python3Packages.josepy
python3Packages.markdown
python3Packages.mozilla-django-oidc
python3Packages.psycopg2
python3Packages.pycparser
python3Packages.pyopenssl
python3Packages.python-dateutil
python3Packages.requests
python3Packages.setuptools
python3Packages.six
python3Packages.soupsieve
python3Packages.sqlparse
python3Packages.supervisor
python3Packages.urllib3
python3Packages.waybackpy
python3Packages.webencodings
uwsgi
];

nativeBuildInputs = [
nodejs
npmHooks.npmConfigHook
];

buildPhase = ''
runHook preBuild
# Based on $src/docker/alpine.Dockerfile
# node-build stage
npm run build
mkdir --parents data/{assets,favicons,previews} dist
npm run build
python manage.py collectstatic
cp --no-preserve=all --recursive . "$out/"
runHook postBuild
'';

nativeCheckInputs = [
python3Packages.django-debug-toolbar
python3Packages.playwright
];

checkPhase = ''
runHook preCheck
python manage.py test bookmarks.tests
export PLAYWRIGHT_BROWSERS_PATH=${playwright-driver.browsers}
python manage.py test bookmarks.e2e --pattern="e2e_test_*.py"
runHook postCheck
'';

passthru = {
tests = {
nixos = nixosTests.linkding;
};
updateScript = nix-update-script { };
};

meta = {
description = "Self-hosted bookmark manager";
homepage = "https://github.com/sissbruecker/linkding";
changelog = "https://github.com/sissbruecker/linkding/blob/master/CHANGELOG.md";
license = lib.licenses.mit;
platforms = lib.platforms.linux;
maintainers = [ lib.maintainers.l0b0 ];
};
}

0 comments on commit ee0916a

Please sign in to comment.