mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-12 02:40:31 +08:00
43
pkgs/by-name/ch/chhoto-url/package.nix
Normal file
43
pkgs/by-name/ch/chhoto-url/package.nix
Normal 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";
|
||||
};
|
||||
})
|
||||
Reference in New Issue
Block a user