nixpkgs/pkgs/by-name/ra/ran/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

48 lines
1.0 KiB
Nix

{ buildGoModule
, fetchFromGitHub
, lib
, runCommand
, ran
, curl
}:
buildGoModule rec {
pname = "ran";
version = "0.1.6";
src = fetchFromGitHub {
owner = "m3ng9i";
repo = "ran";
rev = "v${version}";
hash = "sha256-iMvUvzr/jaTNdgHQFuoJNJnnkx2XHIUUlrPWyTlreEw=";
};
vendorHash = "sha256-ObroruWWNilHIclqNvbEaa7vwk+1zMzDKbjlVs7Fito=";
CGO_ENABLED = 0;
ldflags = [
"-X" "main._version_=v${version}"
"-X" "main._branch_=master"
];
passthru.tests = {
simple = runCommand "ran-test" { } ''
echo hello world > index.html
${ran}/bin/ran &
# Allow ran to fully initialize
sleep 1
[ "$(${curl}/bin/curl 127.0.0.1:8080)" == "hello world" ]
kill %1
${ran}/bin/ran --version > $out
'';
};
meta = with lib; {
homepage = "https://github.com/m3ng9i/ran";
description = "Ran is a simple web server for serving static files";
mainProgram = "ran";
license = licenses.mit;
maintainers = with maintainers; [ tomberek ];
};
}