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