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";
|
2020-02-05 19:27:16 +01:00
|
|
|
version = "1.0";
|
2019-11-05 11:57:05 +01: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-02-05 19:27:16 +01:00
|
|
|
rev = "88c680c9abf0f04f2e294436d20073ccf26f0781";
|
|
|
|
sha256 = "1415mhdr0pwvshs04clfz1ys76r5qf9jz8jchm63l6llaj6m7mrv";
|
2019-11-05 11:57:05 +01:00
|
|
|
};
|
|
|
|
|
2020-02-28 05:22:49 +01:00
|
|
|
cargoSha256 = "1iwd0cad8dp8q5xz2mm7zn1wphr5brkw937dfygc88afj6bv3d68";
|
2019-11-05 11:57:05 +01:00
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
BUILD_REV_COUNT = src.revCount or 1;
|
|
|
|
RUN_TIME_CLOSURE = pkgs.callPackage ./runtime.nix {};
|
|
|
|
|
2020-01-09 17:02:17 +01:00
|
|
|
nativeBuildInputs = with pkgs; [ rustPackages.rustfmt ];
|
2019-11-05 11:57:05 +01:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|