2021-03-09 03:18:52 +00:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, pkgs
|
2021-03-09 03:18:52 +00:00
|
|
|
|
, rustPackages
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, fetchFromGitHub
|
|
|
|
|
, rustPlatform
|
2020-07-18 16:06:22 +00:00
|
|
|
|
, writers
|
2020-04-24 23:36:52 +00:00
|
|
|
|
, nixosTests
|
|
|
|
|
, CoreServices
|
|
|
|
|
, Security
|
|
|
|
|
}:
|
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
|
let
|
|
|
|
|
# Run `eval $(nix-build -A lorri.updater)` after updating the revision!
|
2022-10-21 18:38:19 +00:00
|
|
|
|
# It will copy some required files if necessary.
|
|
|
|
|
# Also don’t forget to run `nix-build -A lorri.tests`
|
2024-09-19 14:19:46 +00:00
|
|
|
|
version = "1.7.1";
|
|
|
|
|
sha256 = "sha256-dEdKMgE4Jd8CCvtGQDZNDCYOomZAV8aR7Cmtyn8RfTo=";
|
|
|
|
|
cargoHash = "sha256-+sKxKxc2DVHn54uQa8K+CKmm0A0ym9SXgtOcfRZ6R5E=";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-03-09 03:18:52 +00:00
|
|
|
|
owner = "nix-community";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
repo = pname;
|
2024-07-27 06:49:29 +00:00
|
|
|
|
rev = version;
|
2020-08-20 17:08:02 +00:00
|
|
|
|
inherit sha256;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
|
outputs = [ "out" "man" "doc" ];
|
|
|
|
|
|
2024-07-31 10:19:44 +00:00
|
|
|
|
inherit cargoHash;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
|
|
BUILD_REV_COUNT = src.revCount or 1;
|
2021-03-09 03:18:52 +00:00
|
|
|
|
RUN_TIME_CLOSURE = pkgs.callPackage ./runtime.nix { };
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
|
nativeBuildInputs = [ rustPackages.rustfmt ];
|
2024-09-26 11:04:55 +00:00
|
|
|
|
buildInputs = lib.optionals stdenv.hostPlatform.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;
|
|
|
|
|
};
|
|
|
|
|
};
|
2021-03-09 03:18:52 +00:00
|
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
|
description = "Your project's nix-env";
|
2024-07-27 06:49:29 +00:00
|
|
|
|
homepage = "https://github.com/nix-community/lorri";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
license = licenses.asl20;
|
2024-07-27 06:49:29 +00:00
|
|
|
|
maintainers = with maintainers; [ grahamc Profpatsch nyarly ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
mainProgram = "lorri";
|
2021-03-09 03:18:52 +00:00
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
|
})
|