2019-11-05 11:57:05 +01:00
|
|
|
{ stdenv
|
|
|
|
, pkgs
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
# Updater script
|
|
|
|
, runtimeShell
|
|
|
|
, writeScript
|
|
|
|
# Tests
|
|
|
|
, nixosTests
|
|
|
|
# Apple dependencies
|
|
|
|
, CoreServices
|
|
|
|
, Security
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "lorri";
|
|
|
|
version = "unstable-2019-10-30";
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Your project's nix-env";
|
|
|
|
homepage = "https://github.com/target/lorri";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ grahamc Profpatsch ];
|
|
|
|
};
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "target";
|
|
|
|
repo = pname;
|
|
|
|
# Run `eval $(nix-build -A lorri.updater)` after updating the revision!
|
|
|
|
rev = "03f10395943449b1fc5026d3386ab8c94c520ee3";
|
|
|
|
sha256 = "0fcl79ndaziwd8d74mk1lsijz34p2inn64b4b4am3wsyk184brzq";
|
|
|
|
};
|
|
|
|
|
|
|
|
cargoSha256 = "1daff4plh7hwclfp21hkx4fiflh9r80y2c7k2sd3zm4lmpy0jpfz";
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
BUILD_REV_COUNT = src.revCount or 1;
|
|
|
|
RUN_TIME_CLOSURE = pkgs.callPackage ./runtime.nix {};
|
|
|
|
|
|
|
|
nativeBuildInputs = with pkgs; [ nix direnv which ];
|
|
|
|
buildInputs =
|
2019-12-27 18:33:52 +01:00
|
|
|
stdenv.lib.optionals stdenv.isDarwin [ CoreServices Security ];
|
2019-11-05 11:57:05 +01:00
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updater = with builtins; writeScript "copy-runtime-nix.sh" ''
|
|
|
|
#!${runtimeShell}
|
|
|
|
set -euo pipefail
|
|
|
|
cp ${src}/nix/runtime.nix ${toString ./runtime.nix}
|
|
|
|
cp ${src}/nix/runtime-closure.nix.template ${toString ./runtime-closure.nix.template}
|
|
|
|
'';
|
|
|
|
tests = {
|
|
|
|
nixos = nixosTests.lorri;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|