depot/third_party/nixpkgs/pkgs/tools/misc/lorri/default.nix
Default email 1ffc76754d Project import generated by Copybara.
GitOrigin-RevId: a5cc7d3197705f933d88e97c0c61849219ce76c1
2020-07-18 18:06:22 +02:00

55 lines
1.4 KiB
Nix
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{ stdenv
, pkgs
, fetchFromGitHub
, rustPlatform
# Updater script
, runtimeShell
, writers
# Tests
, nixosTests
# Apple dependencies
, CoreServices
, Security
}:
rustPlatform.buildRustPackage rec {
pname = "lorri";
version = "1.1";
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!
# ALSO dont forget to update the cargoSha256!
rev = "93d93013217cd9aa09d2bd316d6c3abf827a6601";
sha256 = "0wbkx8hmikngfp6fp0y65yla22f3k0jszq8a6pas80q0b33llwm5";
};
cargoSha256 = "1a3n1ylyp63x6v7b07nnqpfxjzmsgwmgraza23lx8z4gh167gv46";
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 = {
updater = writers.writeBash "copy-runtime-nix.sh" ''
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;
};
};
}