diff --git a/pkgs/by-name/st/strichliste/frontend.nix b/pkgs/by-name/st/strichliste/frontend.nix new file mode 100644 index 000000000000..a30c4fff3766 --- /dev/null +++ b/pkgs/by-name/st/strichliste/frontend.nix @@ -0,0 +1,43 @@ +{ + stdenv, + fetchFromGitHub, + fetchYarnDeps, + nodejs, + yarnConfigHook, + yarnBuildHook, + meta, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "strichliste-frontend"; + version = "2.0.0"; + + src = fetchFromGitHub { + owner = "strichliste"; + repo = "strichliste-web-frontend"; + tag = "v${finalAttrs.version}"; + hash = "sha256-fi4pz3ylWyC4yvDWsK2Rvv8KDaXeHNVz0jY6PpF07hE="; + }; + + yarnOfflineCache = fetchYarnDeps { + yarnLock = finalAttrs.src + "/yarn.lock"; + hash = "sha256-leMwcsyhbxPoHJdA3kZDz97Ti77d1TCe8SrzTQMGrWo="; + }; + + env.NODE_OPTIONS = "--openssl-legacy-provider"; + + nativeBuildInputs = [ + nodejs + yarnConfigHook + yarnBuildHook + ]; + + installPhase = '' + mkdir $out + cp -R build/* $out/ + ''; + + __structuredAttrs = true; + + inherit meta; +}) diff --git a/pkgs/by-name/st/strichliste/package.nix b/pkgs/by-name/st/strichliste/package.nix new file mode 100644 index 000000000000..c71a7a9b0840 --- /dev/null +++ b/pkgs/by-name/st/strichliste/package.nix @@ -0,0 +1,51 @@ +{ + callPackage, + fetchFromGitHub, + lib, + pkgs, + php ? pkgs.php85, +}: + +php.buildComposerProject2 (finalAttrs: { + pname = "strichliste-backend"; + version = "2.0.1"; + + src = fetchFromGitHub { + owner = "strichliste"; + repo = "strichliste-backend"; + tag = "v${finalAttrs.version}"; + hash = "sha256-yI20cUp19ehtOnWdu+MItwgOlNDnt1VK3giInaTQQ4Y="; + }; + + vendorHash = "sha256-vYPjUaNIf62GoKXopC4nGqIa+Z3C8Q5dnX9FPvM1Ers="; + composerNoDev = true; + composerStrictValidation = false; + + postPatch = '' + substituteInPlace config/services.yaml \ + --replace-fail "strichliste.yaml" "/etc/strichliste.yaml" + ''; + + postInstall = '' + mkdir $out/bin + ln -s $out/share/php/strichliste-backend/bin/console $out/bin/strichliste-console + ''; + + __structuredAttrs = true; + + passthru = { + frontend = callPackage ./frontend.nix { + inherit (finalAttrs) meta; + }; + phpPackage = php; + }; + + meta = { + description = "strichliste is a tool to replace a tally sheet."; + homepage = "https://www.strichliste.org/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ hexa ]; + mainProgram = "strichliste-console"; + platforms = lib.platforms.all; + }; +})