nixpkgs/pkgs/tools/misc/lorri/default.nix
Profpatsch c7c81dced8 lorri: 1.2.0 -> 1.3.0
We forked lorri to nix-community, so this release also moves us over
to the new official repository.

Release notes:

Fix the build loop.

Previously, any change (for example a direnv ping or a change in the
nix files) would add a new build invocation to the queue, and the
builds would all be done one after the other.

However, a new build will always use the newest state of the files
anyway, so the CPU time spent on all the other builds will be
wasted (and hog your processor).

Now lorri will only

    finish the current build (if running)
    schedule at maximum one additional build if requested

This should improve the resource use drastically in some situations.

---

Make lorri daemon exit with exit code 0 instead of 130/143 on
SIGINT or SIGTERM.

---

Add lorri self-upgrade branch sub-subcommand.
This enables us to point users to a branch name, in order to test out
fixes from repository branches.
2021-03-05 23:49:36 +01:00

74 lines
1.8 KiB
Nix

{ lib, stdenv
, pkgs
, fetchFromGitHub
, rustPlatform
# Updater script
, runtimeShell
, writers
# Tests
, nixosTests
# Apple dependencies
, CoreServices
, Security
}:
let
# Run `eval $(nix-build -A lorri.updater)` after updating the revision!
version = "1.3";
gitRev = "a26745e404c3a201fe98af4c000bb27f910542b1";
sha256 = "0gfkqvla2cphyhnl5xw19yf1v4pvwsvphr019y5r914cwqwnkb92";
cargoSha256 = "1a1alhpivlmxy8iv0ki7s0b8hf3hadashf81rzn207wn3yihsnaf";
in (rustPlatform.buildRustPackage rec {
pname = "lorri";
inherit version;
meta = with lib; {
description = "Your project's nix-env";
homepage = "https://github.com/nix-community/lorri";
license = licenses.asl20;
maintainers = with maintainers; [ grahamc Profpatsch ];
};
src = fetchFromGitHub {
owner = "nix-community";
repo = pname;
rev = gitRev;
inherit sha256;
};
outputs = [ "out" "man" "doc" ];
inherit cargoSha256;
doCheck = false;
BUILD_REV_COUNT = src.revCount or 1;
RUN_TIME_CLOSURE = pkgs.callPackage ./runtime.nix {};
nativeBuildInputs = with pkgs; [ rustPackages.rustfmt ];
buildInputs =
lib.optionals stdenv.isDarwin [ CoreServices Security ];
# 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
'';
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;
};
};
})