2019-11-05 10:57:05 +00:00
|
|
|
|
{ stdenv
|
|
|
|
|
, pkgs
|
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
, rustPlatform
|
|
|
|
|
# Updater script
|
|
|
|
|
, runtimeShell
|
2020-06-30 01:09:13 +01:00
|
|
|
|
, writers
|
2019-11-05 10:57:05 +00:00
|
|
|
|
# Tests
|
|
|
|
|
, nixosTests
|
|
|
|
|
# Apple dependencies
|
|
|
|
|
, CoreServices
|
|
|
|
|
, Security
|
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
|
pname = "lorri";
|
2020-06-30 01:09:13 +01:00
|
|
|
|
version = "1.1";
|
2019-11-05 10:57:05 +00:00
|
|
|
|
|
|
|
|
|
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!
|
2020-06-30 01:09:13 +01:00
|
|
|
|
# ALSO don’t forget to update the cargoSha256!
|
|
|
|
|
rev = "93d93013217cd9aa09d2bd316d6c3abf827a6601";
|
|
|
|
|
sha256 = "0wbkx8hmikngfp6fp0y65yla22f3k0jszq8a6pas80q0b33llwm5";
|
2019-11-05 10:57:05 +00:00
|
|
|
|
};
|
|
|
|
|
|
2020-06-30 01:09:13 +01:00
|
|
|
|
cargoSha256 = "1a3n1ylyp63x6v7b07nnqpfxjzmsgwmgraza23lx8z4gh167gv46";
|
2019-11-05 10:57:05 +00:00
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
|
|
BUILD_REV_COUNT = src.revCount or 1;
|
|
|
|
|
RUN_TIME_CLOSURE = pkgs.callPackage ./runtime.nix {};
|
|
|
|
|
|
2020-01-09 16:02:17 +00:00
|
|
|
|
nativeBuildInputs = with pkgs; [ rustPackages.rustfmt ];
|
2019-11-05 10:57:05 +00:00
|
|
|
|
buildInputs =
|
2019-12-27 17:33:52 +00:00
|
|
|
|
stdenv.lib.optionals stdenv.isDarwin [ CoreServices Security ];
|
2019-11-05 10:57:05 +00:00
|
|
|
|
|
|
|
|
|
passthru = {
|
2020-06-30 01:09:13 +01:00
|
|
|
|
updater = writers.writeBash "copy-runtime-nix.sh" ''
|
2019-11-05 10:57:05 +00:00
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
}
|