about summary refs log tree commit diff
path: root/pkgs/by-name/re/resorter/package.nix
blob: c717ff495462bb21d1a2a1a1a50bc857cebc33a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
{
  lib,
  fetchFromGitHub,
  rPackages,
  rWrapper,
  stdenv,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "resorter";
  version = "0-unstable-2023-07-14";

  src = fetchFromGitHub {
    owner = "hiAndrewQuinn";
    repo = "resorter";
    rev = "81f8922d41d062794e1563a468cb5ca78680436b";
    hash = "sha256-oC1atQNxwXcsTjom/SCBUsLhHJJEBwqKh0BN9/mvRTU=";
  };

  buildInputs = [
    (rWrapper.override {
      packages = with rPackages; [
        BradleyTerry2
        argparser
      ];
    })
  ];

  installPhase = ''
    runHook preInstall

    mkdir -pv $out/bin/
    cp -v resorter.r $out/bin/resorter

    runHook postInstall
  '';

  meta = {
    description = "Tool to sort a list of items based on pairwise comparisons";
    homepage = "https://github.com/hiAndrewQuinn/resorter";
    license = with lib.licenses; [ cc0 ];
    mainProgram = "resorter";
    maintainers = with lib.maintainers; [ AndersonTorres ];
    platforms = lib.platforms.all;
  };
})