···
13
+
version = "2.0.0-rc.4";
14
+
src = fetchFromGitHub {
15
+
owner = "plankanban";
17
+
tag = "v${version}";
18
+
hash = "sha256-RUOIOXrpoNGxoKwUlgkPsk4kTnA95E+iwYIjBzSBoTA=";
21
+
description = "Kanban-style project mastering tool for everyone";
22
+
homepage = "https://docs.planka.cloud/";
24
+
fullName = "Planka Community License";
25
+
url = "https://github.com/plankanban/planka/blob/master/LICENSE.md";
27
+
redistributable = true;
29
+
maintainers = with lib.maintainers; [ pyrox0 ];
32
+
frontend = stdenv.mkDerivation (finalAttrs: {
33
+
pname = "planka-frontend";
34
+
inherit version src meta;
36
+
sourceRoot = "${finalAttrs.src.name}/client";
38
+
npmDeps = fetchNpmDeps {
39
+
inherit (finalAttrs) src sourceRoot;
40
+
hash = "sha256-XtVwO8253XBVtG0jrikeVr1yaS1PpphCbN5B6jz54qc=";
47
+
nativeBuildInputs = [
48
+
npmHooks.npmConfigHook
58
+
# Replace dart path in sass-embedded since node_modules doesn't have the native binary
59
+
substituteInPlace node_modules/sass-embedded/dist/lib/src/compiler-path.js \
60
+
--replace-fail 'compilerCommand = (() => {' 'compilerCommand = (() => { return ["${lib.getExe dart-sass}"];'
77
+
serverPython = python3.withPackages (ps: [ ps.apprise ]);
79
+
stdenv.mkDerivation (finalAttrs: {
81
+
inherit version src meta;
83
+
sourceRoot = "${finalAttrs.src.name}/server";
85
+
npmDeps = fetchNpmDeps {
86
+
inherit (finalAttrs) src sourceRoot;
87
+
hash = "sha256-yW9uzPALGdPrrUV129ToXayLyeLbAK9mCl2emCPYUdc=";
90
+
npmFlags = [ "--ignore-scripts" ];
92
+
nativeBuildInputs = [
93
+
npmHooks.npmConfigHook
103
+
# Patch notifs helper to use nixpkgs' python
104
+
substituteInPlace api/helpers/utils/send-notifications.js \
105
+
--replace-fail '(`$' '(`' \
106
+
--replace-fail "{sails.config.appPath}/.venv/bin/python3" "${lib.getExe serverPython}"
120
+
npm prune --omit=dev --no-save $npmFlags "$${npmFlagsArray[@]}"
121
+
find node_modules -maxdepth 1 -type d -empty -delete
123
+
mkdir -p $out/lib/node_modules/planka
125
+
mv * $out/lib/node_modules/planka
126
+
cp -t $out/lib/node_modules/planka/public -r ${frontend}/dist/*
127
+
cp ${frontend}/dist/index.html $out/lib/node_modules/planka/views/index.html
129
+
ln -s $out/lib/node_modules/planka/start.sh $out/bin/planka
131
+
runHook postInstall
134
+
passthru.updateScript = nix-update-script { extraArgs = [ "--version=unstable" ]; };