nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 rustPlatform,
5 fetchFromCodeberg,
6 installShellFiles,
7}:
8
9rustPlatform.buildRustPackage rec {
10 pname = "mitra";
11 version = "4.16.1";
12
13 src = fetchFromCodeberg {
14 owner = "silverpill";
15 repo = "mitra";
16 rev = "v${version}";
17 hash = "sha256-nQhzU3LMEyqa2CciNTX5/+ViMqjmwDt3QrMZnbt/tBU=";
18 };
19
20 cargoHash = "sha256-aWBJ3PDHcqm73P4oOpuSlalT5LxRgSqhuC0f0/sL+lg=";
21
22 # require running database
23 doCheck = false;
24
25 env.RUSTFLAGS = toString [
26 # MEMO: mitra use ammonia crate with unstable rustc flag
27 "--cfg=ammonia_unstable"
28 ];
29
30 buildFeatures = [
31 "production"
32 ];
33
34 nativeBuildInputs = [
35 installShellFiles
36 ];
37
38 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
39 installShellCompletion --cmd mitra \
40 --bash <($out/bin/mitra completion --shell bash) \
41 --fish <($out/bin/mitra completion --shell fish) \
42 --zsh <($out/bin/mitra completion --shell zsh)
43 '';
44
45 meta = {
46 description = "Federated micro-blogging platform";
47 homepage = "https://codeberg.org/silverpill/mitra";
48 license = lib.licenses.agpl3Only;
49 maintainers = with lib.maintainers; [ haruki7049 ];
50 mainProgram = "mitra";
51 };
52}