about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/oa/oauth2ms/package.nix
blob: 0a4787bacd7d467a6c4c0be8378e8d6e9baecfd0 (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
{ lib, stdenv, fetchFromGitHub, python3 }:

stdenv.mkDerivation {
  pname = "oauth2ms";
  version = "2021-07-09";

  src = fetchFromGitHub {
    owner = "harishkrupo";
    repo = "oauth2ms";
    rev = "a1ef0cabfdea57e9309095954b90134604e21c08"; # No tags or releases in the repo
    sha256 = "sha256-xPSWlHJAXhhj5I6UMjUtH1EZqCZWHJMFWTu3a4k1ETc";
  };

  buildInputs = [
    (python3.withPackages (ps: with ps; [
      pyxdg
      msal
      python-gnupg
    ]))
  ];

  installPhase = ''
    runHook preInstall
    install -m755 -D oauth2ms $out/bin/oauth2ms
    runHook postInstall
  '';

  meta = with lib; {
    homepage = "https://github.com/harishkrupo/oauth2ms";
    description = "XOAUTH2 compatible Office365 token fetcher";
    mainProgram = "oauth2ms";
    platforms = platforms.all;
    license = licenses.asl20;
    maintainers = with maintainers; [ wentasah ];
  };
}