As Sears Holdings heads toward an imminent bankruptcy filing, the struggling retailer is nearing a deal with lenders that could keep it alive through Christmas, people familiar with the matter tell CNBC.

Such a deal would allow Sears to keep open some of its roughly 900 stores for at least a little bit longer, these people say. The goal would be to stay open until at least Christmas with a hope of finding a buyer while Sears is in bankruptcy, the people said.

As part of the deal, Sears would shutter some of its stores immediately. It is now looking at first closing roughly 150 of its department and discount stores, one of the people told CNBC. It is unclear how the closures would impact Sears' roughly 90,000 workers.

Sears has not yet finalized a buyer for the business. It will likely seek one after filing for bankruptcy.

The retailer is in talks to initially raise $300 million to $500 million to support its holiday operations, the people said. That amount may increase over time.

The people cautioned the negotiations are in flux and no deal has yet been formalized.

Even if Sears finalizes financing to make it through the holidays, challenges remain. Over the past decade, Sears has had just one quarter of positive same-store sales. It has sold off or spun off its most-prized brands and valuable real estate. Thinning cash flow has left it with little money to reinvest in the company itself, letting it become more irrelevant as new competitors like rise.

Retailers don't have a great track record of emerging from bankruptcy. Several of late, like Toys R Us, have been forced to liquidate. It is difficult to make changes needed, like investing in e-commerce, stores and a company's brand, while still catering to creditors' demands.

Sears still has some valuable businesses, like its storied Kenmore appliance brand and home improvement division. Eddie Lampert's hedge fund, ESL Investments, in August made a bid to buy the brands, but the deal has not yet been granted approval by the special committee appointed to oversee it.

The committee has not formerly rejected Lampert's offer, a person familiar with the matter said.

Still, it finds itself in an awkward position. It has been forced to choose between approving a deal that could stave off bankruptcy and potentially expose itself to litigation. Industry experts have suggested Sears may have made itself vulnerable to lawsuits by its strategy of selling its valuable assets to pay down its debt, instead of putting more money toward rehabilitating the company or paying down its pension.

Sears lost $508 million during the second quarter as sales tumbled at a double-digit pace. Its adjusted loss before interest, taxes, depreciation and amortization widened to $112 million, compared with a loss of $66 million during the same quarter a year earlier. Sales at stores open at least 12 months also fell 3.9 percent during the second quarter, which ended Aug. 4.

It has a $134 million debt payment due Monday that it previously said it may not be able to cover.

The people requested anonymity because the information is confidential. Sears did not immediately respond to a request for comment.