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
|
|
|
|
|
}:
|
|
|
|
|
|
2020-07-28 23:12:37 +01:00
|
|
|
|
(rustPlatform.buildRustPackage rec {
|
2019-11-05 10:57:05 +00:00
|
|
|
|
pname = "lorri";
|
2020-07-28 23:12:37 +01:00
|
|
|
|
version = "1.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!
|
2020-07-28 23:12:37 +01:00
|
|
|
|
rev = "05ea21170a18800e83b3dcf1e3d347f83a9fa992";
|
|
|
|
|
sha256 = "1lgig5q1anmmmc1i1qnbx8rd8mqvm5csgnlaxlj4l4rxjmgiv06n";
|
2019-11-05 10:57:05 +00:00
|
|
|
|
};
|
|
|
|
|
|
2020-07-28 23:12:37 +01:00
|
|
|
|
cargoSha256 = "16asbpq47f3zcv4j9rzqx9v1317qz7xjr7dxd019vpr88zyk4fi1";
|
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
|
|
|
|
|
2020-07-28 23:12:37 +01:00
|
|
|
|
# copy the docs to the $man and $doc outputs
|
|
|
|
|
postInstall = ''
|
|
|
|
|
install -Dm644 lorri.1 $man/share/man/man1/lorri.1
|
|
|
|
|
install -Dm644 -t $doc/share/doc/lorri/ \
|
|
|
|
|
README.md \
|
|
|
|
|
CONTRIBUTING.md \
|
|
|
|
|
LICENSE \
|
|
|
|
|
MAINTAINERS.md
|
|
|
|
|
cp -r contrib/ $doc/share/doc/lorri/contrib
|
|
|
|
|
'';
|
|
|
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
};
|
2020-07-28 23:12:37 +01:00
|
|
|
|
}).overrideAttrs (old: {
|
|
|
|
|
# add man and doc outputs to put our documentation into
|
|
|
|
|
outputs = old.outputs or [ "out" ] ++ [ "man" "doc" ];
|
|
|
|
|
})
|