Files
nixpkgs/pkgs/by-name/st/static-server/package.nix
Ben Siraphob 5506449838 pkgs/by-name: fix typos
Assisted-by: Claude Code (claude-opus-5)
2026-08-05 09:56:33 -07:00

60 lines
1.2 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
curl,
stdenv,
testers,
static-server,
replaceVars,
}:
buildGoModule (finalAttrs: {
pname = "static-server";
version = "1.2.1";
src = fetchFromGitHub {
owner = "eliben";
repo = "static-server";
rev = "v${finalAttrs.version}";
hash = "sha256-AZcNh/kF6IdAceA7qe+nhRlwU4yGh19av/S1Zt7iKIs=";
};
vendorHash = "sha256-1p3dCLLo+MTPxf/Y3zjxTagUi+tq7nZSj4ZB/aakJGY=";
patches = [
# patch out debug.ReadBuildInfo since version information is not available with buildGoModule
(replaceVars ./version.patch {
inherit (finalAttrs) version;
})
];
nativeCheckInputs = [
curl
];
ldflags = [
"-s"
"-w"
];
# tests sometimes fail with SIGQUIT on darwin
doCheck = !stdenv.hostPlatform.isDarwin;
passthru.tests = {
version = testers.testVersion {
package = static-server;
};
};
__darwinAllowLocalNetworking = true;
meta = {
description = "Simple, zero-configuration HTTP server CLI for serving static files";
homepage = "https://github.com/eliben/static-server";
license = lib.licenses.unlicense;
maintainers = [ ];
mainProgram = "static-server";
};
})