1{
2 lib,
3 buildNpmPackage,
4 fetchFromGitHub,
5 nodejs,
6 nix-update-script,
7 nixosTests,
8}:
9buildNpmPackage rec {
10 pname = "db-rest";
11 version = "6.1.0";
12
13 inherit nodejs;
14
15 src = fetchFromGitHub {
16 owner = "derhuerst";
17 repo = "db-rest";
18 rev = version;
19 hash = "sha256-1iJ26l6C6GevNkoDVMztPHiH3YsutJa3xWAsfYvgR9U=";
20 };
21
22 npmDepsHash = "sha256-ELVVsysNjkXuX4i6i5P3irn6twVDu6YiPYqy2hbIlIs=";
23
24 preConfigure = ''
25 patchShebangs ./build/index.js
26 '';
27
28 passthru.updateScript = nix-update-script { };
29 passthru.tests = {
30 inherit (nixosTests) db-rest;
31 };
32
33 meta = {
34 description = "Clean REST API wrapping around the Deutsche Bahn API";
35 homepage = "https://v6.db.transport.rest/";
36 license = lib.licenses.isc;
37 maintainers = with lib.maintainers; [ marie ];
38 mainProgram = "db-rest";
39 };
40}