nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 versionCheckHook,
6 nix-update-script,
7 openssl,
8 pkg-config,
9}:
10rustPlatform.buildRustPackage (finalAttrs: {
11 pname = "codesnap";
12 version = "0.13.1";
13
14 src = fetchFromGitHub {
15 owner = "codesnap-rs";
16 repo = "codesnap";
17 tag = "v${finalAttrs.version}";
18 hash = "sha256-baTIxqfxxoHl7h81pboFlze5m/EMiEx9YOMfV0UPESI=";
19 };
20
21 cargoHash = "sha256-bi5vvUDMI4WxIpv0sHESmLg3vwAIbNQ11pbJDuSe8z4=";
22
23 nativeBuildInputs = [ pkg-config ];
24
25 buildInputs = [ openssl ];
26
27 cargoBuildFlags = [
28 "-p"
29 "codesnap-cli"
30 ];
31 cargoTestFlags = finalAttrs.cargoBuildFlags;
32
33 env.OPENSSL_NO_VENDOR = true;
34
35 nativeInstallCheckInputs = [
36 versionCheckHook
37 ];
38
39 doInstallCheck = true;
40
41 passthru.updateScript = nix-update-script { };
42
43 meta = {
44 description = "Command-line tool for generating beautiful code snippets";
45 homepage = "https://github.com/mistricky/CodeSnap";
46 changelog = "https://github.com/mistricky/CodeSnap/releases/tag/v${finalAttrs.version}";
47 license = lib.licenses.mit;
48 maintainers = with lib.maintainers; [ nartsiss ];
49 mainProgram = "codesnap";
50 };
51})