Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / virtualization / charliecloud / default.nix
blob2889d09183d77ad62deae801cf2fdef04073fcb7
1 { lib, stdenv, fetchFromGitHub, python3, docker, autoreconfHook, coreutils, makeWrapper, gnused, gnutar, gzip, findutils, sudo, nixosTests }:
3 stdenv.mkDerivation rec {
5   version = "0.24";
6   pname = "charliecloud";
8   src = fetchFromGitHub {
9     owner = "hpc";
10     repo = "charliecloud";
11     rev = "v${version}";
12     sha256 = "sha256-kdaVlwE3vdCxsmJTOUwx8J+9UcBuXbKDwS2MHX2ZPPM=";
13   };
15   nativeBuildInputs = [ autoreconfHook makeWrapper ];
16   buildInputs = [
17     docker
18     (python3.withPackages (ps: [ ps.lark ps.requests ]))
19   ];
21   configureFlags = let
22     pythonEnv = python3.withPackages (ps: [ ps.lark ps.requests ]);
23   in [
24     "--with-python=${pythonEnv}/bin/python3"
25   ];
27   preConfigure = ''
28     patchShebangs test/
29     substituteInPlace configure.ac --replace "/usr/bin/env" "${coreutils}/bin/env"
30   '';
32   makeFlags = [
33     "PREFIX=$(out)"
34     "LIBEXEC_DIR=lib/charliecloud"
35   ];
37   # Charliecloud calls some external system tools.
38   # Here we wrap those deps so they are resolved inside nixpkgs.
39   postInstall = ''
40     for file in $out/bin/* ; do \
41       wrapProgram $file --prefix PATH : ${lib.makeBinPath [ coreutils docker gnused gnutar gzip findutils sudo ]}
42     done
43   '';
45   passthru.tests.charliecloud = nixosTests.charliecloud;
47   meta = {
48     description = "User-defined software stacks (UDSS) for high-performance computing (HPC) centers";
49     longDescription = ''
50       Charliecloud uses Linux user namespaces to run containers with no
51       privileged operations or daemons and minimal configuration changes on
52       center resources. This simple approach avoids most security risks
53       while maintaining access to the performance and functionality already
54       on offer.
55     '';
56     homepage = "https://hpc.github.io/charliecloud";
57     license = lib.licenses.asl20;
58     maintainers = [ lib.maintainers.bzizou ];
59     platforms = lib.platforms.linux;
60   };