about summary refs log tree commit diff
path: root/pkgs/development/interpreters/nextflow/default.nix
blob: ed07f175b65351ae96eb499cd461762ec443b884 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{ lib
, stdenv
, fetchurl
, makeWrapper
, openjdk17
, wget
, which
, gnused
, gawk
, coreutils
, buildFHSEnv
}:

let
  nextflow =
stdenv.mkDerivation rec {
  pname = "nextflow";
  version = "22.10.6";

  src = fetchurl {
    url = "https://github.com/nextflow-io/nextflow/releases/download/v${version}/nextflow-${version}-all";
    hash = "sha256-zeYsKxWRnzr0W6CD+yjoAXwCN/AbN5P4HhH1oftnrjY=";
  };

  nativeBuildInputs = [
    makeWrapper
    openjdk17
    wget
    which
    gnused
    gawk
    coreutils
  ];

  dontUnpack = true;

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    install -Dm755 $src $out/bin/nextflow

    runHook postInstall
  '';

  postFixup = ''
    wrapProgram $out/bin/nextflow \
      --prefix PATH : ${lib.makeBinPath nativeBuildInputs} \
      --set JAVA_HOME ${openjdk17.home}
  '';

  meta = with lib; {
    description = "DSL for data-driven computational pipelines";
    longDescription = ''
      Nextflow is a bioinformatics workflow manager that enables the development of portable and reproducible workflows.

      It supports deploying workflows on a variety of execution platforms including local, HPC schedulers, AWS Batch, Google Cloud Life Sciences, and Kubernetes.

      Additionally, it provides support for manage your workflow dependencies through built-in support for Conda, Docker, Singularity, and Modules.
    '';
    homepage = "https://www.nextflow.io/";
    changelog = "https://github.com/nextflow-io/nextflow/releases";
    license = licenses.asl20;
    maintainers = with maintainers; [ Etjean edmundmiller ];
    mainProgram = "nextflow";
    platforms = platforms.unix;
  };
};
in
if stdenv.isLinux then
  buildFHSEnv
  {
    name = "nextflow";
    targetPkgs = pkgs: [ nextflow ];
    runScript = "nextflow";
  }
else nextflow