2022-02-20 18:42:01 +00:00
|
|
|
{
|
2022-02-20 20:49:15 +00:00
|
|
|
description = "jujutsu";
|
2022-02-20 18:42:01 +00:00
|
|
|
|
2022-02-21 17:14:48 +00:00
|
|
|
outputs = { self, nixpkgs, ... }:
|
2022-02-20 18:42:01 +00:00
|
|
|
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: {
|
2022-02-20 20:49:15 +00:00
|
|
|
jujutsu = final.callPackage
|
2022-02-20 18:42:01 +00:00
|
|
|
(
|
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, pkgconfig
|
|
|
|
, openssl
|
|
|
|
, dbus
|
|
|
|
, sqlite
|
|
|
|
, file
|
|
|
|
, gzip
|
|
|
|
, makeWrapper
|
|
|
|
, Security
|
|
|
|
, SystemConfiguration
|
|
|
|
, libiconv
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "jujutsu";
|
2022-02-21 17:14:48 +00:00
|
|
|
version = "unstable-${self.shortRev or "dirty"}";
|
2022-02-20 18:42:01 +00:00
|
|
|
|
|
|
|
src = self;
|
|
|
|
|
|
|
|
cargoLock = {
|
|
|
|
lockFile = "${self}/Cargo.lock";
|
|
|
|
};
|
2022-02-21 17:14:48 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig gzip makeWrapper ];
|
2022-02-20 18:42:01 +00:00
|
|
|
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;
|
2022-02-21 17:14:48 +00:00
|
|
|
overlays = [ self.overlay ];
|
2022-02-20 18:42:01 +00:00
|
|
|
};
|
|
|
|
in
|
|
|
|
{
|
2022-02-20 20:49:15 +00:00
|
|
|
packages.${system}.jujutsu = pkgs.jujutsu;
|
|
|
|
defaultPackage.${system} = self.packages.${system}.jujutsu;
|
2022-02-20 21:53:04 +00:00
|
|
|
defaultApp.${system} = {
|
|
|
|
type = "app";
|
|
|
|
program = "${pkgs.jujutsu}/bin/jj";
|
|
|
|
};
|
2022-02-20 20:49:15 +00:00
|
|
|
checks.${system}.jujutsu = pkgs.jujutsu.overrideAttrs ({ ... }: {
|
2022-02-20 18:42:01 +00:00
|
|
|
cargoBuildType = "debug";
|
|
|
|
cargoCheckType = "debug";
|
|
|
|
preCheck = ''
|
|
|
|
export RUST_BACKTRACE=1
|
|
|
|
'';
|
|
|
|
});
|
|
|
|
}));
|
|
|
|
}
|