2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, 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
|
|
|
|
}:
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
let
|
|
|
|
# Run `eval $(nix-build -A lorri.updater)` after updating the revision!
|
|
|
|
version = "1.2";
|
|
|
|
gitRev = "43a260c221d5dac4a44fd82271736c8444474eec";
|
|
|
|
sha256 = "0g6zq27dpr8bdan5xrqchybpbqwnhhc7x8sxbfygigbqd3xv9i6n";
|
|
|
|
cargoSha256 = "1zmlp14v7av0znmjyy2aq83lc74503p6r0l11l9iw7s3xad8rda4";
|
|
|
|
|
|
|
|
in (rustPlatform.buildRustPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "lorri";
|
2020-08-20 17:08:02 +00:00
|
|
|
inherit version;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
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;
|
2020-08-20 17:08:02 +00:00
|
|
|
rev = gitRev;
|
|
|
|
inherit sha256;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
outputs = [ "out" "man" "doc" ];
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
inherit cargoSha256;
|
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 =
|
2021-01-15 22:18:51 +00:00
|
|
|
lib.optionals stdenv.isDarwin [ CoreServices Security ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00: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
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
})
|