anchor.diff:  
     postInstall = ''
       # install desktop entry
  -    mkdir -p $out/share/applications
  -    cp ${desktopItem}/share/applications/* $out/share/applications
  +    install -Dm644 -t $out/share/applications \
  +      ${desktopItem}/share/applications/*
   
       # install icons
       for n in 16 24 32 48 64 96 128 256; do
         size=$n"x"$n
  -      mkdir -p $out/share/icons/hicolor/$size/apps
  -      cp $src/images/appicons/$size.png \
  -         $out/share/icons/hicolor/$size/apps/monero.png
  +      install -Dm644 \
  +        -t $out/share/icons/hicolor/$size/apps/monero.png \
  +        $src/images/appicons/$size.png
       done;
     '';
   
  
positive.code:     sha256 = "1i9a3ampppyzsl4sllbqlr3w43sjpb3fdfxhb1j4n49p8g0jzmf3";
    };
  
    nativeBuildInputs = [ qmake pkgconfig wrapQtAppsHook ];
  
    buildInputs = [
      qtbase qtdeclarative qtgraphicaleffects
      qtmultimedia qtquickcontrols qtquickcontrols2
      qtxmlpatterns
      monero unbound readline libgcrypt libgpgerror
      boost libunwind libsodium pcsclite zeromq
      hidapi libusb-compat-0_1 protobuf randomx
    ];
  
    NIX_CFLAGS_COMPILE = [ "-Wno-error=format-security" ];
  
    patches = [ ./move-log-file.patch ];
  
    postPatch = ''
      echo '
        var GUI_VERSION = "${version}";
        var GUI_MONERO_VERSION = "${getVersion monero}";
      ' > version.js
      substituteInPlace monero-wallet-gui.pro \
        --replace '$$[QT_INSTALL_BINS]/lrelease' '${getDev qttools}/bin/lrelease'
      substituteInPlace src/daemon/DaemonManager.cpp \
        --replace 'QApplication::applicationDirPath() + "' '"${monero}/bin'
    '';
  
    makeFlags = [ "INSTALL_ROOT=$(out)" ];
  
    preBuild = ''
      sed -i s#/opt/monero-wallet-gui##g Makefile
      make -C src/zxcvbn-c
  
      # use nixpkgs monero sources
      rmdir monero
      ln -s "${monero.src}" monero
    '';
  
    desktopItem = makeDesktopItem {
      name = "monero-wallet-gui";
  
negative.code: { stdenv, wrapQtAppsHook, makeDesktopItem
  , fetchFromGitHub
  , cmake, qttools, pkgconfig
  , qtbase, qtdeclarative, qtgraphicaleffects
  , qtmultimedia, qtxmlpatterns
  , qtquickcontrols, qtquickcontrols2
  , monero, miniupnpc, unbound, readline
  , boost, libunwind, libsodium, pcsclite
  , randomx, zeromq, libgcrypt, libgpgerror
  , hidapi, rapidjson
  , trezorSupport ? true
  ,   libusb1  ? null
  ,   protobuf ? null
  ,   python3  ? null
  }:
  
  with stdenv.lib;
  
  assert trezorSupport -> all (x: x!=null) [ libusb1 protobuf python3 ];
  
  stdenv.mkDerivation rec {
    pname = "monero-gui";
  