2022-12-28 21:21:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, qttools
|
|
|
|
, darwin
|
|
|
|
|
2020-07-18 16:06:22 +00:00
|
|
|
, asciidoctor
|
2022-05-18 14:49:53 +00:00
|
|
|
, botan2
|
2020-04-24 23:36:52 +00:00
|
|
|
, curl
|
|
|
|
, libXi
|
|
|
|
, libXtst
|
|
|
|
, libargon2
|
2022-05-18 14:49:53 +00:00
|
|
|
, libusb1
|
|
|
|
, minizip
|
|
|
|
, pcsclite
|
2020-04-24 23:36:52 +00:00
|
|
|
, pkg-config
|
|
|
|
, qrencode
|
|
|
|
, qtbase
|
|
|
|
, qtmacextras
|
|
|
|
, qtsvg
|
|
|
|
, qtx11extras
|
2021-05-20 23:08:51 +00:00
|
|
|
, readline
|
2022-03-30 09:31:56 +00:00
|
|
|
, wrapGAppsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, wrapQtAppsHook
|
|
|
|
, zlib
|
|
|
|
|
|
|
|
, withKeePassBrowser ? true
|
2022-10-30 15:09:59 +00:00
|
|
|
, withKeePassFDOSecrets ? true
|
2020-04-24 23:36:52 +00:00
|
|
|
, withKeePassKeeShare ? true
|
2020-11-19 00:13:47 +00:00
|
|
|
, withKeePassNetworking ? true
|
2022-10-30 15:09:59 +00:00
|
|
|
, withKeePassSSHAgent ? true
|
2020-04-24 23:36:52 +00:00
|
|
|
, withKeePassTouchID ? true
|
2022-10-30 15:09:59 +00:00
|
|
|
, withKeePassX11 ? true
|
2022-05-18 14:49:53 +00:00
|
|
|
, withKeePassYubiKey ? true
|
2021-02-22 21:28:39 +00:00
|
|
|
|
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
with lib;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "keepassxc";
|
2022-11-02 22:02:43 +00:00
|
|
|
version = "2.7.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "keepassxreboot";
|
|
|
|
repo = "keepassxc";
|
|
|
|
rev = version;
|
2022-11-02 22:02:43 +00:00
|
|
|
sha256 = "sha256-amedKK9nplLVJTldeabN3/c+g/QesrdH+qx+rba2/4s=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
NIX_CFLAGS_COMPILE = optionalString stdenv.cc.isClang [
|
2020-04-24 23:36:52 +00:00
|
|
|
"-Wno-old-style-cast"
|
|
|
|
"-Wno-error"
|
|
|
|
"-D__BIG_ENDIAN__=${if stdenv.isBigEndian then "1" else "0"}"
|
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
NIX_LDFLAGS = optionalString stdenv.isDarwin "-rpath ${libargon2}/lib";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
patches = [
|
|
|
|
./darwin.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DKEEPASSXC_BUILD_TYPE=Release"
|
|
|
|
"-DWITH_GUI_TESTS=ON"
|
|
|
|
"-DWITH_XC_UPDATECHECK=OFF"
|
|
|
|
]
|
2022-10-30 15:09:59 +00:00
|
|
|
++ (optional (!withKeePassX11) "-DWITH_XC_X11=OFF")
|
|
|
|
++ (optional (withKeePassFDOSecrets && stdenv.isLinux) "-DWITH_XC_FDOSECRETS=ON")
|
|
|
|
++ (optional (withKeePassYubiKey && stdenv.isLinux) "-DWITH_XC_YUBIKEY=ON")
|
2020-04-24 23:36:52 +00:00
|
|
|
++ (optional withKeePassBrowser "-DWITH_XC_BROWSER=ON")
|
|
|
|
++ (optional withKeePassKeeShare "-DWITH_XC_KEESHARE=ON")
|
|
|
|
++ (optional withKeePassNetworking "-DWITH_XC_NETWORKING=ON")
|
|
|
|
++ (optional withKeePassSSHAgent "-DWITH_XC_SSHAGENT=ON");
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
2021-02-05 17:12:51 +00:00
|
|
|
runHook preCheck
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
export LC_ALL="en_US.UTF-8"
|
|
|
|
export QT_QPA_PLATFORM=offscreen
|
|
|
|
export QT_PLUGIN_PATH="${qtbase.bin}/${qtbase.qtPluginPrefix}"
|
2022-12-28 21:21:41 +00:00
|
|
|
# testcli, testgui and testkdbx4 are flaky - skip them all
|
|
|
|
# testautotype on darwin throws "QWidget: Cannot create a QWidget without QApplication"
|
|
|
|
make test ARGS+="-E 'testcli|testgui${lib.optionalString stdenv.isDarwin "|testautotype|testkdbx4"}' --output-on-failure"
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
runHook postCheck
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
nativeBuildInputs = [ asciidoctor cmake wrapGAppsHook wrapQtAppsHook qttools pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
dontWrapGApps = true;
|
2022-12-02 08:20:57 +00:00
|
|
|
preFixup = ''
|
2022-06-16 17:23:12 +00:00
|
|
|
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
2022-12-28 21:21:41 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
|
|
|
wrapQtApp "$out/Applications/KeePassXC.app/Contents/MacOS/KeePassXC"
|
2022-06-16 17:23:12 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [
|
|
|
|
curl
|
2022-05-18 14:49:53 +00:00
|
|
|
botan2
|
2020-04-24 23:36:52 +00:00
|
|
|
libXi
|
|
|
|
libXtst
|
|
|
|
libargon2
|
2022-05-18 14:49:53 +00:00
|
|
|
minizip
|
|
|
|
pcsclite
|
2020-04-24 23:36:52 +00:00
|
|
|
qrencode
|
|
|
|
qtbase
|
|
|
|
qtsvg
|
2021-05-20 23:08:51 +00:00
|
|
|
readline
|
2020-04-24 23:36:52 +00:00
|
|
|
zlib
|
|
|
|
]
|
2022-10-30 15:09:59 +00:00
|
|
|
++ optional (stdenv.isDarwin && withKeePassTouchID) darwin.apple_sdk.frameworks.LocalAuthentication
|
2021-05-20 23:08:51 +00:00
|
|
|
++ optional stdenv.isDarwin qtmacextras
|
2022-10-30 15:09:59 +00:00
|
|
|
++ optional stdenv.isLinux libusb1
|
|
|
|
++ optional withKeePassX11 qtx11extras;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-22 21:28:39 +00:00
|
|
|
passthru.tests = nixosTests.keepassxc;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
2021-05-20 23:08:51 +00:00
|
|
|
description = "Offline password manager with many features.";
|
|
|
|
longDescription = ''
|
|
|
|
A community fork of KeePassX, which is itself a port of KeePass Password Safe.
|
|
|
|
The goal is to extend and improve KeePassX with new features and bugfixes,
|
|
|
|
to provide a feature-rich, fully cross-platform and modern open-source password manager.
|
|
|
|
Accessible via native cross-platform GUI, CLI, has browser integration
|
|
|
|
using the KeePassXC Browser Extension (https://github.com/keepassxreboot/keepassxc-browser)
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://keepassxc.org/";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = licenses.gpl2Plus;
|
2022-10-21 18:38:19 +00:00
|
|
|
maintainers = with maintainers; [ jonafato turion srapenne ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
|
|
|
};
|
|
|
|
}
|