anchor.diff:      maintainers = with maintainers; [ LunNova ];
       mainProgram = "input-remapper-gtk";
     };
  -}
  +}).overrideAttrs (final: prev: {
  +  # Set in an override as buildPythonApplication doesn't yet support
  +  # the `final:` arg yet from #119942 'overlay style overridable recursive attributes'
  +  # this ensures the rev matches the input src's rev after overriding
  +  # See https://discourse.nixos.org/t/avoid-rec-expresions-in-nixpkgs/8293/7 for more
  +  # discussion
  +  postPatch = prev.postPatch or "" + ''
  +    # set revision for --version output
  +    echo "COMMIT_HASH = '${final.src.rev}'" > inputremapper/commit_hash.py
  +  '';
  +})
  
positive.code:   # at startup, see https://github.com/NixOS/nixpkgs/issues/56943
    strictDeps = false;
  
    prePatch = ''
      # set revision for --version output
      echo "COMMIT_HASH = '${input_remapper_src_rev}'" > inputremapper/commit_hash.py
  
      # fix FHS paths
      substituteInPlace inputremapper/configs/data.py \
        --replace "/usr/share/input-remapper"  "$out/usr/share/input-remapper"
    '' + (lib.optionalString (withDebugLogLevel) ''
      # if debugging
      substituteInPlace inputremapper/logger.py --replace "logger.setLevel(logging.INFO)"  "logger.setLevel(logging.DEBUG)"
    '');
  
    doCheck = withDoCheck;
    checkInputs = [
  
negative.code:   # failures when building. Override this to true to run tests anyway
    # See upstream issue: https://github.com/sezanzeb/input-remapper/issues/306
  , withDoCheck ? false
  }:
  
  let
    maybeXmodmap = lib.optional withXmodmap xmodmap;
  in
  (buildPythonApplication {
    pname = "input-remapper";
    version = "1.5.0";
  
    src = fetchFromGitHub {
      rev = "e31a1b2bc5d23fe13130afcc242063196335399f";
      owner = "sezanzeb";
      repo = "input-remapper";
      hash = "sha256-KPQLgXSonuOgphagYN2JN+CMIpmjTIPUTCqOPDk0UYU=";
    };
  
    # Fixes error
  