fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{
2 lib,
3 stdenv,
4 rustPlatform,
5 fetchFromGitHub,
6 installShellFiles,
7 gitMinimal,
8 gnupg,
9 openssh,
10 buildPackages,
11 nix-update-script,
12 versionCheckHook,
13}:
14
15rustPlatform.buildRustPackage (finalAttrs: {
16 pname = "jujutsu";
17 version = "0.31.0";
18
19 src = fetchFromGitHub {
20 owner = "jj-vcs";
21 repo = "jj";
22 tag = "v${finalAttrs.version}";
23 hash = "sha256-4zDHSpi7Kk7rramrWFOlBelZnOxt0zgXIrHucYQUOz0=";
24 };
25
26 cargoHash = "sha256-QmMc7pG2FMJBI9AIGPRRh2juFoz7gRFw5CQIcNK6QZI=";
27
28 nativeBuildInputs = [
29 installShellFiles
30 ];
31
32 nativeCheckInputs = [
33 gitMinimal
34 gnupg
35 openssh
36 ];
37
38 cargoBuildFlags = [
39 # Don’t install the `gen-protos` build tool.
40 "--bin"
41 "jj"
42 ];
43
44 useNextest = true;
45
46 cargoTestFlags = [
47 # Don’t build the `gen-protos` build tool when running tests.
48 "-p"
49 "jj-lib"
50 "-p"
51 "jj-cli"
52 ];
53
54 # taplo-cli (used in tests) always creates a reqwest client, which
55 # requires configd access on macOS.
56 sandboxProfile = ''
57 (allow mach-lookup (global-name "com.apple.SystemConfiguration.configd"))
58 '';
59
60 env = {
61 # Disable vendored libraries.
62 ZSTD_SYS_USE_PKG_CONFIG = "1";
63 LIBGIT2_NO_VENDOR = "1";
64 LIBSSH2_SYS_USE_PKG_CONFIG = "1";
65 };
66
67 postInstall =
68 let
69 jj = "${stdenv.hostPlatform.emulator buildPackages} $out/bin/jj";
70 in
71 lib.optionalString (stdenv.hostPlatform.emulatorAvailable buildPackages) ''
72 mkdir -p $out/share/man
73 ${jj} util install-man-pages $out/share/man/
74
75 installShellCompletion --cmd jj \
76 --bash <(COMPLETE=bash ${jj}) \
77 --fish <(COMPLETE=fish ${jj}) \
78 --zsh <(COMPLETE=zsh ${jj})
79 '';
80
81 doInstallCheck = true;
82 nativeInstallCheckInputs = [ versionCheckHook ];
83 versionCheckProgram = "${placeholder "out"}/bin/jj";
84 versionCheckProgramArg = "--version";
85
86 passthru = {
87 updateScript = nix-update-script { };
88 };
89
90 meta = {
91 description = "Git-compatible DVCS that is both simple and powerful";
92 homepage = "https://github.com/jj-vcs/jj";
93 changelog = "https://github.com/jj-vcs/jj/blob/v${finalAttrs.version}/CHANGELOG.md";
94 license = lib.licenses.asl20;
95 maintainers = with lib.maintainers; [
96 _0x4A6F
97 thoughtpolice
98 emily
99 bbigras
100 ];
101 mainProgram = "jj";
102 };
103})