1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 20:21:14 +00:00
nixpkgs/pkgs/tools/security/bitwarden/default.nix

73 lines
1.7 KiB
Nix
Raw Normal View History

2019-08-02 05:48:20 +01:00
{ atomEnv
, autoPatchelfHook
, dpkg
, fetchurl
2021-05-27 20:14:18 +01:00
, lib
2019-08-02 05:48:20 +01:00
, libsecret
2021-11-03 19:37:50 +00:00
, libxshmfence
2019-08-02 05:48:20 +01:00
, makeDesktopItem
, makeWrapper
, stdenv
, udev
, wrapGAppsHook
}:
2021-11-03 19:37:50 +00:00
stdenv.mkDerivation rec {
2019-08-02 05:48:20 +01:00
pname = "bitwarden";
2021-12-15 18:34:38 +00:00
version = "1.30.0";
2019-08-02 05:48:20 +01:00
2021-11-03 19:37:50 +00:00
src = fetchurl {
url = "https://github.com/bitwarden/desktop/releases/download/v${version}/Bitwarden-${version}-amd64.deb";
2021-12-15 18:34:38 +00:00
sha256 = "sha256-x0i7MUVr0nhPy8M/dTVtRjaLfJQlzqhzLQ/JHLRmL6E=";
2019-08-02 05:48:20 +01:00
};
2021-11-03 19:37:50 +00:00
desktopItem = makeDesktopItem {
name = "bitwarden";
exec = "bitwarden %U";
icon = "bitwarden";
comment = "A secure and free password manager for all of your devices";
desktopName = "Bitwarden";
categories = "Utility";
};
2019-08-02 05:48:20 +01:00
2021-11-03 19:37:50 +00:00
dontBuild = true;
dontConfigure = true;
dontPatchELF = true;
dontWrapGApps = true;
2019-08-02 05:48:20 +01:00
2021-11-03 19:37:50 +00:00
nativeBuildInputs = [ dpkg makeWrapper autoPatchelfHook wrapGAppsHook ];
2019-08-02 05:48:20 +01:00
2021-11-03 19:37:50 +00:00
buildInputs = [ libsecret libxshmfence ] ++ atomEnv.packages;
2019-08-02 05:48:20 +01:00
2021-11-03 19:37:50 +00:00
unpackPhase = "dpkg-deb -x $src .";
2019-08-02 05:48:20 +01:00
2021-11-03 19:37:50 +00:00
installPhase = ''
mkdir -p "$out/bin"
cp -R "opt" "$out"
cp -R "usr/share" "$out/share"
chmod -R g-w "$out"
2019-08-02 05:48:20 +01:00
2021-11-03 19:37:50 +00:00
# Desktop file
mkdir -p "$out/share/applications"
cp "${desktopItem}/share/applications/"* "$out/share/applications"
'';
2019-08-02 05:48:20 +01:00
2021-11-03 19:37:50 +00:00
runtimeDependencies = [
(lib.getLib udev)
];
2019-08-02 05:48:20 +01:00
2021-11-03 19:37:50 +00:00
postFixup = ''
makeWrapper $out/opt/Bitwarden/bitwarden $out/bin/bitwarden \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libsecret stdenv.cc.cc ] }" \
"''${gappsWrapperArgs[@]}"
'';
2019-08-02 05:48:20 +01:00
2021-11-03 19:37:50 +00:00
meta = with lib; {
description = "A secure and free password manager for all of your devices";
homepage = "https://bitwarden.com";
license = licenses.gpl3;
maintainers = with maintainers; [ kiwi ];
platforms = [ "x86_64-linux" ];
2019-08-02 05:48:20 +01:00
};
2021-11-03 19:37:50 +00:00
}