mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
755b915a15
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \ | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
56 lines
1.2 KiB
Nix
56 lines
1.2 KiB
Nix
{ lib
|
|
, buildGoModule
|
|
, fetchFromGitHub
|
|
, curl
|
|
, stdenv
|
|
, testers
|
|
, static-server
|
|
, substituteAll
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "static-server";
|
|
version = "1.2.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "eliben";
|
|
repo = "static-server";
|
|
rev = "v${version}";
|
|
hash = "sha256-AZcNh/kF6IdAceA7qe+nhRlwU4yGh19av/S1Zt7iKIs=";
|
|
};
|
|
|
|
vendorHash = "sha256-1p3dCLLo+MTPxf/Y3zjxTagUi+tq7nZSj4ZB/aakJGY=";
|
|
|
|
patches = [
|
|
# patch out debug.ReadBuidlInfo since version information is not available with buildGoModule
|
|
(substituteAll {
|
|
src = ./version.patch;
|
|
inherit version;
|
|
})
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
curl
|
|
];
|
|
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
# tests sometimes fail with SIGQUIT on darwin
|
|
doCheck = !stdenv.isDarwin;
|
|
|
|
passthru.tests = {
|
|
version = testers.testVersion {
|
|
package = static-server;
|
|
};
|
|
};
|
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
meta = with lib; {
|
|
description = "Simple, zero-configuration HTTP server CLI for serving static files";
|
|
homepage = "https://github.com/eliben/static-server";
|
|
license = licenses.unlicense;
|
|
maintainers = with maintainers; [ figsoda ];
|
|
mainProgram = "static-server";
|
|
};
|
|
}
|