diff --git a/pkgs/by-name/rf/rfc-reader/package.nix b/pkgs/by-name/rf/rfc-reader/package.nix new file mode 100644 index 000000000000..6a0f5d646f62 --- /dev/null +++ b/pkgs/by-name/rf/rfc-reader/package.nix @@ -0,0 +1,50 @@ +{ + lib, + rustPlatform, + fetchFromGitHub, + pkg-config, + openssl, + nix-update-script, + testers, +}: + +rustPlatform.buildRustPackage (finalAttrs: { + pname = "rfc-reader"; + version = "0.11.2"; + + src = fetchFromGitHub { + owner = "ozan2003"; + repo = "rfc_reader"; + tag = "v${finalAttrs.version}"; + hash = "sha256-Hm8BVIMxRlyiVptvuS8vk2eO3hHboj5CRefWcMEhzvs="; + }; + + cargoHash = "sha256-ro0BVMbShxo/EsPBOCBOgYDsOkDnxpyTZlk2eAJ2IWA="; + + __structuredAttrs = true; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ + openssl + ]; + + passthru.updateScript = nix-update-script { }; + + passthru.tests.version = testers.testVersion { + package = finalAttrs.finalPackage; + # The version command triggers logging unconditionally, have to create a temp directory + command = "HOME=$(mktemp -d) rfc_reader --version"; + }; + + meta = { + description = "RFC viewer with TUI"; + homepage = "https://github.com/ozan2003/rfc_reader"; + changelog = "https://github.com/ozan2003/rfc_reader/blob/${finalAttrs.src.rev}/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ frantathefranta ]; + mainProgram = "rfc_reader"; + }; +})