From fe61cef1ba7cb4f5c668fb9caa178433f5fd4a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 19 Aug 2023 15:46:04 -0700 Subject: [PATCH] http-server: use buildNpmPackage --- pkgs/by-name/ht/http-server/package.nix | 38 +++++++++++ pkgs/development/node-packages/aliases.nix | 1 + .../node-packages/node-packages.json | 1 - .../node-packages/node-packages.nix | 63 ------------------- 4 files changed, 39 insertions(+), 64 deletions(-) create mode 100644 pkgs/by-name/ht/http-server/package.nix diff --git a/pkgs/by-name/ht/http-server/package.nix b/pkgs/by-name/ht/http-server/package.nix new file mode 100644 index 000000000000..9a058ac255ba --- /dev/null +++ b/pkgs/by-name/ht/http-server/package.nix @@ -0,0 +1,38 @@ +{ lib +, buildNpmPackage +, fetchFromGitHub +, fetchpatch2 +}: + +buildNpmPackage rec { + pname = "http-server"; + version = "14.1.1"; + + src = fetchFromGitHub { + owner = "http-party"; + repo = "http-server"; + rev = "v${version}"; + hash = "sha256-M/YC721QWJfz5sYX6RHm1U9WPHVRBD0ZL2/ceYItnhs="; + }; + + patches = [ + # https://github.com/http-party/http-server/pull/875 + (fetchpatch2 { + name = "regenerate-package-lock.patch"; + url = "https://github.com/http-party/http-server/commit/0cbd85175f1a399c4d13c88a25c5483a9f1dea08.patch"; + hash = "sha256-hJyiUKZfuSaXTsjFi4ojdaE3rPHgo+N8k5Hqete+zqk="; + }) + ]; + + npmDepsHash = "sha256-iUTDdcibnstbSxC7cD5WbwSxQbfiIL2iNyMWJ8izSu0="; + + dontNpmBuild = true; + + meta = { + description = "A simple zero-configuration command-line http server"; + homepage = "https://github.com/http-party/http-server"; + license = lib.licenses.mit; + mainProgram = "http-server"; + maintainers = with lib.maintainers; [ ]; + }; +} diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 84e2dfa1289b..e541dbad0b5e 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -87,6 +87,7 @@ mapAliases { inherit (pkgs) hsd; # added 2023-08-19 inherit (pkgs) html-minifier; # added 2023-08-19 inherit (pkgs) htmlhint; # added 2023-08-19 + inherit (pkgs) http-server; # added 2024-01-20 hueadm = pkgs.hueadm; # added 2023-07-31 inherit (pkgs) hyperpotamus; # added 2023-08-19 immich = pkgs.immich-cli; # added 2023-08-19 diff --git a/pkgs/development/node-packages/node-packages.json b/pkgs/development/node-packages/node-packages.json index df6dc59e3c11..354dbaf2e231 100644 --- a/pkgs/development/node-packages/node-packages.json +++ b/pkgs/development/node-packages/node-packages.json @@ -131,7 +131,6 @@ , "gulp" , "gulp-cli" , "he" -, "http-server" , "hs-airdrop" , "ijavascript" , "inliner" diff --git a/pkgs/development/node-packages/node-packages.nix b/pkgs/development/node-packages/node-packages.nix index a7e1580f8d58..45c478949078 100644 --- a/pkgs/development/node-packages/node-packages.nix +++ b/pkgs/development/node-packages/node-packages.nix @@ -79283,69 +79283,6 @@ in bypassCache = true; reconstructLock = true; }; - http-server = nodeEnv.buildNodePackage { - name = "http-server"; - packageName = "http-server"; - version = "14.1.1"; - src = fetchurl { - url = "https://registry.npmjs.org/http-server/-/http-server-14.1.1.tgz"; - sha512 = "+cbxadF40UXd9T01zUHgA+rlo2Bg1Srer4+B4NwIHdaGxAGGv59nYRnGGDJ9LBk7alpS0US+J+bLLdQOOkJq4A=="; - }; - dependencies = [ - sources."ansi-styles-4.3.0" - sources."async-2.6.4" - sources."basic-auth-2.0.1" - sources."call-bind-1.0.5" - sources."chalk-4.1.2" - sources."color-convert-2.0.1" - sources."color-name-1.1.4" - sources."corser-2.0.1" - sources."debug-3.2.7" - sources."define-data-property-1.1.1" - sources."eventemitter3-4.0.7" - sources."follow-redirects-1.15.3" - sources."function-bind-1.1.2" - sources."get-intrinsic-1.2.2" - sources."gopd-1.0.1" - sources."has-flag-4.0.0" - sources."has-property-descriptors-1.0.1" - sources."has-proto-1.0.1" - sources."has-symbols-1.0.3" - sources."hasown-2.0.0" - sources."he-1.2.0" - sources."html-encoding-sniffer-3.0.0" - sources."http-proxy-1.18.1" - sources."iconv-lite-0.6.3" - sources."lodash-4.17.21" - sources."mime-1.6.0" - sources."minimist-1.2.8" - sources."mkdirp-0.5.6" - sources."ms-2.1.3" - sources."object-inspect-1.13.1" - sources."opener-1.5.2" - sources."portfinder-1.0.32" - sources."qs-6.11.2" - sources."requires-port-1.0.0" - sources."safe-buffer-5.1.2" - sources."safer-buffer-2.1.2" - sources."secure-compare-3.0.1" - sources."set-function-length-1.1.1" - sources."side-channel-1.0.4" - sources."supports-color-7.2.0" - sources."union-0.5.0" - sources."url-join-4.0.1" - sources."whatwg-encoding-2.0.0" - ]; - buildInputs = globalBuildInputs; - meta = { - description = "A simple zero-configuration command-line http server"; - homepage = "https://github.com/http-party/http-server#readme"; - license = "MIT"; - }; - production = true; - bypassCache = true; - reconstructLock = true; - }; hs-airdrop = nodeEnv.buildNodePackage { name = "hs-airdrop"; packageName = "hs-airdrop";