lol
0
fork

Configure Feed

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

engelsystem: unvendor composer and yarn dependencies

+46 -26
+2 -2
nixos/modules/services/web-apps/engelsystem.nix
··· 134 134 enable = true; 135 135 virtualHosts."${cfg.domain}".locations = { 136 136 "/" = { 137 - root = "${cfg.package}/share/engelsystem/public"; 137 + root = "${cfg.package}/share/php/engelsystem/public"; 138 138 extraConfig = '' 139 139 index index.php; 140 140 try_files $uri $uri/ /index.php?$args; ··· 142 142 ''; 143 143 }; 144 144 "~ \\.php$" = { 145 - root = "${cfg.package}/share/engelsystem/public"; 145 + root = "${cfg.package}/share/php/engelsystem/public"; 146 146 extraConfig = '' 147 147 fastcgi_pass unix:${config.services.phpfpm.pools.engelsystem.socket}; 148 148 fastcgi_index index.php;
+44 -24
pkgs/by-name/en/engelsystem/package.nix
··· 1 1 { 2 2 lib, 3 - fetchzip, 3 + fetchFromGitHub, 4 + fetchYarnDeps, 5 + nodejs, 6 + yarn, 7 + yarnBuildHook, 8 + yarnConfigHook, 4 9 nixosTests, 5 10 php, 6 - stdenv, 7 - writeText, 8 11 }: 9 12 10 - stdenv.mkDerivation rec { 13 + php.buildComposerProject2 (finalAttrs: { 11 14 pname = "engelsystem"; 12 15 version = "3.6.0"; 13 16 14 - src = fetchzip { 15 - url = "https://github.com/engelsystem/engelsystem/releases/download/v${version}/engelsystem-v${version}.zip"; 16 - hash = "sha256-AZVW04bcSlESSRmtfvP2oz15xvZLlGEz/X9rX7PuRGg="; 17 + src = fetchFromGitHub { 18 + owner = "engelsystem"; 19 + repo = "engelsystem"; 20 + tag = "v${finalAttrs.version}"; 21 + hash = "sha256-Pi+nowImUvENx2c4gsku1KkFb3pLM84oT8WevI6ImQg="; 17 22 }; 18 23 19 - buildInputs = [ php ]; 24 + inherit php; 20 25 21 - installPhase = '' 22 - runHook preInstall 26 + vendorHash = "sha256-0Mv48mB/pTQtYd2do6wTdhD/c2zwbU1gTYsdU7rELPY="; 27 + composoerNoDev = true; 28 + composerStrictValidation = false; 23 29 24 - # prepare 25 - rm -r ./storage/ 30 + yarnOfflineCache = fetchYarnDeps { 31 + pname = "${finalAttrs.pname}-yarn-deps"; 32 + yarnLock = "${finalAttrs.src}/yarn.lock"; 33 + hash = "sha256-nyCLM9OF2qwlW+VK38kiRMo6jMlupNFG+91N3Fb/WLY="; 34 + }; 26 35 27 - ln -sf /etc/engelsystem/config.php ./config/config.php 28 - ln -sf /var/lib/engelsystem/storage/ ./storage 36 + strictDeps = true; 29 37 30 - mkdir -p $out/share/engelsystem 31 - mkdir -p $out/bin 32 - cp -r . $out/share/engelsystem 38 + nativeBuildInputs = [ 39 + nodejs 40 + yarn 41 + yarnConfigHook 42 + ]; 33 43 34 - echo $(command -v php) 35 - # The patchShebangAuto function always used the php without extensions, so path the shebang manually 36 - sed -i -e "1 s|.*|#\!${lib.getExe php}|" "$out/share/engelsystem/bin/migrate" 37 - ln -s "$out/share/engelsystem/bin/migrate" "$out/bin/migrate" 44 + preBuild = '' 45 + yarn build 46 + ''; 38 47 39 - runHook postInstall 48 + preInstall = '' 49 + rm -rf node_modules 50 + 51 + # link config and storage into FHS locations 52 + ln -sf /etc/engelsystem/config.php ./config/config.php 53 + rm -rf storage 54 + ln -snf /var/lib/engelsystem/storage/ ./storage 55 + ''; 56 + 57 + postInstall = '' 58 + mkdir $out/bin 59 + ln -s $out/share/php/engelsystem/bin/migrate $out/bin/migrate 40 60 ''; 41 61 42 62 passthru.tests = nixosTests.engelsystem; 43 63 44 64 meta = { 45 - changelog = "https://github.com/engelsystem/engelsystem/releases/tag/v${version}"; 65 + changelog = "https://github.com/engelsystem/engelsystem/releases/tag/v${finalAttrs.version}"; 46 66 description = "Coordinate your volunteers in teams, assign them to work shifts or let them decide for themselves when and where they want to help with what"; 47 67 homepage = "https://engelsystem.de"; 48 68 license = lib.licenses.gpl2Only; ··· 50 70 maintainers = with lib.maintainers; [ ]; 51 71 platforms = lib.platforms.all; 52 72 }; 53 - } 73 + })