forked from martinvonz/jj
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
82 lines (77 loc) · 2.07 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
description = "jujutsu";
outputs = { self, nixpkgs, ... }:
let
lib = nixpkgs.lib;
systems = [
"aarch64-linux"
"aarch64-darwin"
"i686-linux"
"x86_64-darwin"
"x86_64-linux"
];
foreachSystem = f: lib.foldl' (attrs: system: lib.recursiveUpdate attrs (f system)) { } systems;
in
{
overlay = (final: prev: {
jujutsu = final.callPackage
(
{ stdenv
, lib
, fetchFromGitHub
, rustPlatform
, pkgconfig
, openssl
, dbus
, sqlite
, file
, gzip
, makeWrapper
, Security
, SystemConfiguration
, libiconv
}:
rustPlatform.buildRustPackage rec {
pname = "jujutsu";
version = "unstable-${self.shortRev or "dirty"}";
src = self;
cargoLock = {
lockFile = "${self}/Cargo.lock";
};
nativeBuildInputs = [ pkgconfig gzip makeWrapper ];
buildInputs = [ openssl dbus sqlite ]
++ lib.optionals stdenv.isDarwin [
Security
SystemConfiguration
libiconv
];
}
)
{
inherit (final.darwin.apple_sdk.frameworks) Security SystemConfiguration;
};
});
} //
(foreachSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
};
in
{
packages.${system}.jujutsu = pkgs.jujutsu;
defaultPackage.${system} = self.packages.${system}.jujutsu;
defaultApp.${system} = {
type = "app";
program = "${pkgs.jujutsu}/bin/jj";
};
checks.${system}.jujutsu = pkgs.jujutsu.overrideAttrs ({ ... }: {
cargoBuildType = "debug";
cargoCheckType = "debug";
preCheck = ''
export RUST_BACKTRACE=1
'';
});
}));
}