My Nix Configuration
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

[pkgs] planka: init at 2.0.0-rc.4

dish 8781f4a0 3d77a4d1

+158
+158
packages/planka/package.nix
··· 1 + { 2 + lib, 3 + stdenv, 4 + fetchFromGitHub, 5 + fetchNpmDeps, 6 + nix-update-script, 7 + npmHooks, 8 + dart-sass, 9 + nodejs, 10 + python3, 11 + makeBinaryWrapper, 12 + node-gyp, 13 + node-pre-gyp, 14 + }: 15 + let 16 + version = "2.0.0-rc.4"; 17 + src = fetchFromGitHub { 18 + owner = "plankanban"; 19 + repo = "planka"; 20 + tag = "v${version}"; 21 + hash = "sha256-RUOIOXrpoNGxoKwUlgkPsk4kTnA95E+iwYIjBzSBoTA="; 22 + }; 23 + meta = { 24 + description = "Kanban-style project mastering tool for everyone"; 25 + homepage = "https://docs.planka.cloud/"; 26 + license = { 27 + fullName = "Planka Community License"; 28 + url = "https://github.com/plankanban/planka/blob/master/LICENSE.md"; 29 + free = false; 30 + redistributable = true; 31 + }; 32 + maintainers = with lib.maintainers; [ pyrox0 ]; 33 + }; 34 + 35 + frontend = stdenv.mkDerivation (finalAttrs: { 36 + pname = "planka-frontend"; 37 + inherit version src meta; 38 + 39 + sourceRoot = "${finalAttrs.src.name}/client"; 40 + 41 + npmDeps = fetchNpmDeps { 42 + inherit (finalAttrs) src sourceRoot; 43 + hash = "sha256-XtVwO8253XBVtG0jrikeVr1yaS1PpphCbN5B6jz54qc="; 44 + }; 45 + 46 + npmFlags = [ 47 + "--ignore-scripts" 48 + ]; 49 + 50 + nativeBuildInputs = [ 51 + npmHooks.npmConfigHook 52 + nodejs 53 + dart-sass 54 + ]; 55 + 56 + buildPhase = '' 57 + runHook preBuild 58 + 59 + npx patch-package 60 + 61 + # Replace dart path in sass-embedded since node_modules doesn't have the native binary 62 + substituteInPlace node_modules/sass-embedded/dist/lib/src/compiler-path.js \ 63 + --replace-fail 'compilerCommand = (() => {' 'compilerCommand = (() => { return ["${lib.getExe dart-sass}"];' 64 + 65 + npm run build 66 + 67 + runHook postBuild 68 + ''; 69 + 70 + installPhase = '' 71 + runHook preInstall 72 + 73 + mkdir $out/ 74 + mv dist $out/dist 75 + 76 + runHook postInstall 77 + ''; 78 + }); 79 + 80 + serverPython = python3.withPackages (ps: [ ps.apprise ]); 81 + in 82 + stdenv.mkDerivation (finalAttrs: { 83 + pname = "planka"; 84 + inherit version src; 85 + 86 + sourceRoot = "${finalAttrs.src.name}/server"; 87 + 88 + npmDeps = fetchNpmDeps { 89 + inherit (finalAttrs) src sourceRoot; 90 + hash = "sha256-yW9uzPALGdPrrUV129ToXayLyeLbAK9mCl2emCPYUdc="; 91 + }; 92 + 93 + npmFlags = [ "--ignore-scripts" ]; 94 + 95 + nativeBuildInputs = [ 96 + npmHooks.npmConfigHook 97 + nodejs 98 + makeBinaryWrapper 99 + node-pre-gyp 100 + node-gyp 101 + ]; 102 + 103 + buildInputs = [ 104 + serverPython 105 + nodejs 106 + ]; 107 + 108 + preBuild = '' 109 + # Patch notifs helper to use nixpkgs' python 110 + substituteInPlace api/helpers/utils/send-notifications.js \ 111 + --replace-fail '(`$' '(`' \ 112 + --replace-fail "{sails.config.appPath}/.venv/bin/python3" "${lib.getExe serverPython}" 113 + ''; 114 + 115 + buildPhase = '' 116 + runHook preBuild 117 + 118 + npx patch-package 119 + 120 + runHook postBuild 121 + ''; 122 + 123 + installPhase = '' 124 + runHook preInstall 125 + 126 + npm prune --omit=dev --no-save $npmFlags "$${npmFlagsArray[@]}" 127 + find node_modules -maxdepth 1 -type d -empty -delete 128 + 129 + mkdir -p $out/lib/node_modules/planka 130 + mkdir $out/bin 131 + mv * $out/lib/node_modules/planka 132 + rm -rf $out/lib/node_modules/planka/public 133 + cp -r ${frontend}/dist $out/lib/node_modules/planka/public 134 + cp ${frontend}/dist/index.html $out/lib/node_modules/planka/views/index.html 135 + 136 + # Build napi modules 137 + pushd $out/lib/node_modules/planka/node_modules/bcrypt 138 + node-pre-gyp install --build-from-source 139 + rm -rf build-tmp-napi-v3 140 + popd 141 + pushd $out/lib/node_modules/planka/node_modules/lodepng 142 + node-gyp configure 143 + node-gyp build 144 + rm -rf build/Release/obj.target 145 + popd 146 + 147 + makeWrapper $out/lib/node_modules/planka/start.sh $out/bin/planka \ 148 + --chdir $out/lib/node_modules/planka \ 149 + --set sails_paths__public $out/lib/node_modules/planka/public 150 + 151 + runHook postInstall 152 + ''; 153 + 154 + passthru.updateScript = nix-update-script { extraArgs = [ "--version=unstable" ]; }; 155 + meta = meta // { 156 + mainProgram = "planka"; 157 + }; 158 + })