nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 rustPlatform,
6 versionCheckHook,
7 nix-update-script,
8}:
9rustPlatform.buildRustPackage (finalAttrs: {
10 pname = "iwe";
11 version = "0.0.60";
12
13 src = fetchFromGitHub {
14 owner = "iwe-org";
15 repo = "iwe";
16 tag = "iwe-v${finalAttrs.version}";
17 hash = "sha256-PSSH8uytCPtTgxte/wc0TfTiKD96DiVrWFJN9QjuHo8=";
18 };
19
20 cargoHash = "sha256-PqINghZ88FsXj4HEFp0ugFH30lbQfBcoiv86PPOCzLI=";
21
22 cargoBuildFlags = [
23 "--package=iwe"
24 "--package=iwes"
25 ];
26
27 postPatch = ''
28 substituteInPlace crates/iwe/tests/common/mod.rs --replace-fail \
29 'binary_path.push("target");' \
30 'binary_path.push("target/${stdenv.hostPlatform.rust.rustcTarget}");'
31 '';
32
33 nativeInstallCheckInputs = [ versionCheckHook ];
34 doInstallCheck = true;
35
36 passthru.updateScript = nix-update-script {
37 extraArgs = [
38 "--version-regex"
39 "^iwe-v(.*)$"
40 ];
41 };
42
43 meta = {
44 description = "Personal knowledge management system (editor plugin & command line utility)";
45 homepage = "https://iwe.md/";
46 license = lib.licenses.asl20;
47 maintainers = with lib.maintainers; [
48 phrmendes
49 HeitorAugustoLN
50 ];
51 mainProgram = "iwe";
52 };
53})