chhoto-url: init at 6.2.8

(cherry picked from commit 396614dd55)
This commit is contained in:
Defelo
2025-07-12 15:06:00 +02:00
parent 227a373c73
commit 6b8e818471

View File

@@ -0,0 +1,43 @@
{
lib,
rustPlatform,
fetchFromGitHub,
nix-update-script,
}:
rustPlatform.buildRustPackage (finalAttrs: {
pname = "chhoto-url";
version = "6.2.8";
src = fetchFromGitHub {
owner = "SinTan1729";
repo = "chhoto-url";
tag = finalAttrs.version;
hash = "sha256-aWiLfhNbtjsM7fEqoNIKsU12/3b8ORTpZ/4jyqSLmdM=";
};
sourceRoot = "${finalAttrs.src.name}/actix";
postPatch = ''
substituteInPlace src/{main.rs,services.rs} \
--replace-fail "./resources/" "${placeholder "out"}/share/chhoto-url/resources/"
'';
cargoHash = "sha256-rKNGUl1TI21SOBwTuv/TGl46S8FVjCWunJwP5PLdx6g=";
postInstall = ''
mkdir -p $out/share/chhoto-url
cp -r ${finalAttrs.src}/resources $out/share/chhoto-url/resources
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Simple, blazingly fast, selfhosted URL shortener with no unnecessary features";
homepage = "https://github.com/SinTan1729/chhoto-url";
changelog = "https://github.com/SinTan1729/chhoto-url/releases/tag/${finalAttrs.version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ defelo ];
mainProgram = "chhoto-url";
};
})