2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2019-11-05 10:57:05 +00:00
|
|
|
, pkgs
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
# Updater script
|
|
|
|
, runtimeShell
|
2020-06-30 00:09:13 +00:00
|
|
|
, writers
|
2019-11-05 10:57:05 +00:00
|
|
|
# Tests
|
|
|
|
, nixosTests
|
|
|
|
# Apple dependencies
|
|
|
|
, CoreServices
|
|
|
|
, Security
|
|
|
|
}:
|
|
|
|
|
2020-08-04 15:47:29 +00:00
|
|
|
let
|
|
|
|
# Run `eval $(nix-build -A lorri.updater)` after updating the revision!
|
2021-03-05 12:07:31 +00:00
|
|
|
version = "1.3";
|
|
|
|
gitRev = "a26745e404c3a201fe98af4c000bb27f910542b1";
|
|
|
|
sha256 = "0gfkqvla2cphyhnl5xw19yf1v4pvwsvphr019y5r914cwqwnkb92";
|
|
|
|
cargoSha256 = "1a1alhpivlmxy8iv0ki7s0b8hf3hadashf81rzn207wn3yihsnaf";
|
2020-08-04 15:47:29 +00:00
|
|
|
|
|
|
|
in (rustPlatform.buildRustPackage rec {
|
2019-11-05 10:57:05 +00:00
|
|
|
pname = "lorri";
|
2020-08-04 15:47:29 +00:00
|
|
|
inherit version;
|
2019-11-05 10:57:05 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-11-05 10:57:05 +00:00
|
|
|
description = "Your project's nix-env";
|
2021-03-05 12:07:31 +00:00
|
|
|
homepage = "https://github.com/nix-community/lorri";
|
2019-11-05 10:57:05 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ grahamc Profpatsch ];
|
|
|
|
};
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-03-05 12:07:31 +00:00
|
|
|
owner = "nix-community";
|
2019-11-05 10:57:05 +00:00
|
|
|
repo = pname;
|
2020-08-04 15:47:29 +00:00
|
|
|
rev = gitRev;
|
|
|
|
inherit sha256;
|
2019-11-05 10:57:05 +00:00
|
|
|
};
|
|
|
|
|
2020-09-09 13:42:55 +00:00
|
|
|
outputs = [ "out" "man" "doc" ];
|
|
|
|
|
2020-08-04 15:47:29 +00:00
|
|
|
inherit cargoSha256;
|
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 =
|
2021-01-15 09:19:50 +00:00
|
|
|
lib.optionals stdenv.isDarwin [ CoreServices Security ];
|
2019-11-05 10:57:05 +00:00
|
|
|
|
2020-07-28 22:12:37 +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
|
|
|
|
'';
|
|
|
|
|
2019-11-05 10:57:05 +00:00
|
|
|
passthru = {
|
2020-06-30 00:09:13 +00: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 22:12:37 +00:00
|
|
|
})
|