about summary refs log tree commit diff
path: root/pkgs/by-name/aw/aws-gate/package.nix
blob: b1606d3db080326f3cdf7bece288f0da3fc9fb6d (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
{ lib
, fetchFromGitHub
, installShellFiles
, python3Packages
, ssm-session-manager-plugin
}:

python3Packages.buildPythonApplication rec {
  pname = "aws-gate";
  version = "0.11.3";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "xen0l";
    repo = pname;
    rev = version;
    hash = "sha256-9w2jP4s1HXf1gYiXX05Dt2iXt0bR0U48yc8h9T5M+EQ=";
  };

  patches = [
    ./disable-bootstrap.patch
  ];

  postPatch = ''
    rm aws_gate/bootstrap.py tests/unit/test_bootstrap.py
  '';

  nativeBuildInputs = [
    python3Packages.setuptools
    python3Packages.wheel
    installShellFiles
  ];

  propagatedBuildInputs = [ ssm-session-manager-plugin ] ++ builtins.attrValues {
    inherit (python3Packages) marshmallow boto3 pyyaml wrapt cryptography;
  };

  postInstall = ''
    installShellCompletion --bash completions/bash/aws-gate
    installShellCompletion --zsh completions/zsh/_aws-gate
  '';

  checkPhase = ''
    $out/bin/${pname} --version
  '';

  meta = with lib; {
    description = "Better AWS SSM Session manager CLI client";
    homepage = "https://github.com/xen0l/aws-gate";
    license = licenses.bsd3;
    maintainers = with maintainers; [ tirimia ];
    platforms = with platforms; linux ++ darwin;
    mainProgram = pname;
  };
}