summary refs log tree commit diff
path: root/pkgs/desktops/plasma-5/kwallet-pam.nix
blob: 590c523e9d745e137ef1e9d71806318c60748e3f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{ mkDerivation, lib, extra-cmake-modules, pam, socat, libgcrypt, qtbase, kwallet, }:

mkDerivation {
  name = "kwallet-pam";
  nativeBuildInputs = [ extra-cmake-modules ];
  buildInputs = [ pam socat libgcrypt qtbase kwallet ];
  postPatch = ''
    sed -i pam_kwallet_init -e "s|socat|${lib.getBin socat}/bin/socat|"
  '';

  # We get a crash when QT_PLUGIN_PATH is more than 1000 characters.
  # pam_kwallet_init passes its environment to kwalletd5, but
  # wrapQtApps gives our environment a huge QT_PLUGIN_PATH value. We
  # are able to unset it here since kwalletd5 will have its own
  # QT_PLUGIN_PATH.
  postFixup = ''
    wrapProgram $out/libexec/pam_kwallet_init --unset QT_PLUGIN_PATH
  '';

  dontWrapQtApps = true;
}