about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/go/goldwarden/package.nix
blob: 35b18ab1e51c4754160129baf6d14330890fb86d (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
{ lib
, buildGoModule
, fetchFromGitHub
, makeBinaryWrapper
, libfido2
, dbus
, pinentry-gnome3
, nix-update-script
}:

buildGoModule rec {
  pname = "goldwarden";
  version = "0.2.13";

  src = fetchFromGitHub {
    owner = "quexten";
    repo = "goldwarden";
    rev = "v${version}";
    hash = "sha256-4KxPtsIEW46p+cFx6yeSdNlsffy9U31k+ZSkE6V0AFc=";
  };

  vendorHash = "sha256-IH0p7t1qInA9rNYv6ekxDN/BT5Kguhh4cZfmL+iqwVU=";

  ldflags = [ "-s" "-w" ];

  nativeBuildInputs = [makeBinaryWrapper];

  buildInputs = [libfido2];

  postInstall = ''
    wrapProgram $out/bin/goldwarden \
      --suffix PATH : ${lib.makeBinPath [dbus pinentry-gnome3]}

    install -Dm644 $src/resources/com.quexten.goldwarden.policy -t $out/share/polkit-1/actions
  '';

  passthru.updateScript = nix-update-script {};

  meta = with lib; {
    description = "A feature-packed Bitwarden compatible desktop integration";
    homepage = "https://github.com/quexten/goldwarden";
    license = licenses.mit;
    maintainers = with maintainers; [ arthsmn ];
    mainProgram = "goldwarden";
    platforms = platforms.linux; # Support for other platforms is not yet ready, see https://github.com/quexten/goldwarden/issues/4
  };
}