Emacs lsp-mode to use plist

Is it possible to override lsp-mode from nixpkgs to use plists?
If I set env variable as described here it gives some errors, but it isn’t a case if using lsp-mode installed by emacs outside nix.
So my guess is I need to somehow add this env variable to package but I have no idea how to override emacs packages.

I found out I can just use overrideAttrs as in any package.

Can you explain more exactly how did this? I’ve tried using overrideAttrs both on the lsp-mode package and on the emacs package like this:

 programs = {
  	emacs = {
  	  enable = true;
  	  # package = pkgs.emacs-pgtk;
  	  package = (pkgs.emacsWithPackagesFromUsePackage {
  	    package = pkgs.emacs-unstable-pgtk;
  	    config = ./config.org;
  	    alwaysEnsure = false;
  	    alwaysTangle = true;
  	    extraEmacsPackages = epkgs: with epkgs; [
  	      copilot
  	      jinx
          (lsp-mode.overrideAttrs {
            LSP_USE_PLISTS = true;
          })
  	    ];
      }).overrideAttrs {
        LSP_USE_PLISTS = true;
      };
  	};
...

However, I’m still getting those errors

I’ve done something like this

      extraPackages =
        epkgs:
        (packages (
          epkgs.overrideScope (
            ff: pp: {
              lsp-mode = (
                pp.lsp-mode.overrideAttrs (
                  f: p: {
                    buildPhase =
                      ''
                        export LSP_USE_PLISTS=true
                      ''
                      + p.buildPhase;
                  }));
            })));

My full config is here

Thank you. I got it to work now by adding the overrideAttrs to ALL my lsp-related packages while also removing the :ensure t in my emacs config for the same packages