nixpkgs/pkgs/servers/db-rest/default.nix
2024-04-16 10:42:02 +02:00

41 lines
849 B
Nix

{ lib
, buildNpmPackage
, fetchFromGitHub
, nodejs_18
, nix-update-script
, fetchpatch
, nixosTests
}:
buildNpmPackage rec {
pname = "db-rest";
version = "6.0.4";
nodejs = nodejs_18;
src = fetchFromGitHub {
owner = "derhuerst";
repo = pname;
rev = version;
hash = "sha256-guiAtPOvU/yqspq+G+mTSIFqBp6Kl0JZBPfjPC+ZM1g=";
};
npmDepsHash = "sha256-lJT344HpHJFN3QO6kVAj1NhRFTwS+EVkR0ePbtIguFo=";
preConfigure = ''
patchShebangs ./build/index.js
'';
passthru.updateScript = nix-update-script { };
passthru.tests = {
inherit (nixosTests) db-rest;
};
meta = {
description = "A clean REST API wrapping around the Deutsche Bahn API";
homepage = "https://v6.db.transport.rest/";
license = lib.licenses.isc;
maintainers = with lib.maintainers; [ marie ];
mainProgram = "db-rest";
};
}