Skip to content

Drop nixfmt-classic from nixpkgs #340

Closed

Description

@jfly

When doing the stable release, we announced that "The classic nixfmt will stay available for some more time as pkgs.nixfmt-classic" (https://github.com/NixOS/nixpkgs/blob/b3bc1e31d0fc920cc11a79ed4f4bd202961addfb/doc/release-notes/rl-2511.section.md#highlights-sec-nixpkgs-release-2511-highlights).

We should decide exactly how long that is. It seems reasonable to me to wait until the next release (26.05). Concretely, I propose that:

  1. We add a deprecation warning to pkgs.nixfmt-classic now, with the expectation that 25.11 is released with the deprecation warning.
  2. Once 25.11 is cut off from master, we remove pkgs.nixfmt-classic, with the expectation that 26.05 is released with no pkgs.nixfmt-classic.

The plan

  • Do immediately: Move nixfmt-classic to aliases.nix. (It's currently in all-packages).

  • Do immediately: Add a deprecation warning like this:

    nixfmt-classic = (
      if lib.oldestSupportedReleaseIsAtLeast 2605 then
        throw "nixfmt-classic has been removed as it is deprecated and unmaintained."
      else if lib.oldestSupportedReleaseIsAtLeast 2511 then
        lib.warnOnInstantiate
          "nixfmt-classic is deprecated and unmaintained. We recommend switching to nixfmt."
       else
         lib.id
    ) haskellPackages.nixfmt.bin;
  • Once 25.11 is the oldest supported version in master: list the deprecation in nixpkgs' release notes.

  • Once 26.05 is the oldest supported version in master: list the removal in nixpkgs' release notes.

  • Once 26.05 is the oldest supported version in master: simplify the above to just the throw.

  • Drop haskellPackages.nixfmt.bin? (i.e., the deprecated package)

    • We can't fully remove it due to limitations in the hackage→nix pipeline.
    • But we can shadow it with a throw when allowAliases is true.

Activity

  1. sternenseemann commented on Sep 21, 2025

    @sternenseemann
    Member

    Please make sure to keep nixfmt building until then. Currently nixfmt-0.6.0 has too strict bounds to work with Stackage LTS 24 without further workarounds:

    Encountered missing or private dependencies:
        base >=4.12.0 && <4.19,
        filepath >=1.4.2 && <1.5,
        megaparsec >=9.0.1 && <9.6
    

    This could be fixed by a simple Hackage revision (in this case) to

    base < 4.21
    megaparsec < 9.8
    filepath < 1.6
    
  2. jfly commented on Sep 21, 2025

    @jfly
    CollaboratorAuthor

    @sternenseemann, thanks for the heads up.

    We have had some turnover in the team (I don't even know how to do a release to Hackage, because we thought we'd never have to). I know very little about the nixpkgs Haskell package set. Can we relax those constraints with a patch over in nixpkgs (knowing this will go away soon)? Or would it be simplest to get the change on Hackage?

  3. sternenseemann commented on Sep 21, 2025

    @sternenseemann
    Member

    We are currently working around this in Nixpkgs, but that is some extra code we need to keep track of. Also it does not help for anyone using cabal-install or whatever to install directly from Hackage.

    Making a new release is not necessary, a Hackage revision can simply be made in the Hackage web interface. @infinisil of the current team (?) has access.

  4. infinisil commented on Sep 21, 2025

    @infinisil
    Member

    Then I think that's the signal that it should be deprecated it Nixpkgs, instead of spending any more effort on it. It's already deprecated on Hackage as of recently: #161.

  5. sternenseemann commented on Sep 22, 2025

    @sternenseemann
    Member

    Nevermind, I'll just note you won't fix this.

  6. moved this to Todo in Nix formattingon Sep 30, 2025
  7. self-assigned this
    on Sep 30, 2025
  8. nixos-discourse commented on Sep 30, 2025

    @nixos-discourse
  9. moved this from Todo to Blocked in Nix formattingon Oct 6, 2025
  10. MattSturgeon commented on Aug 18, 2026

    @MattSturgeon
    Contributor

    Since NixOS/nixpkgs#537394 bumped the "oldest supported release" to 26.05, nixfmt-classic has become a throw (previously it was a warning).

    We've opened NixOS/nixpkgs#554007 which should mean the nixfmt-classic and nixfmt-rfc-style aliases get automatically cleaned up with other aliases. Therefore, this is now done. 🎉

  11. nixos-discourse commented on Aug 18, 2026

    @nixos-discourse
  12. MattSturgeon commented on Aug 18, 2026

    @MattSturgeon
    Contributor

    Actually there are some unresolved TODO items in the issue description; I'll re-open for now.

  13. MattSturgeon commented on Aug 19, 2026

    @MattSturgeon
    Contributor

    The last remaining item is now the release notes.

    However, I'm not convinced we need to add a release note entry for removing already deprecated attributes. IIUC, release notes should focus on more significant change.

    If someone feels we should add release notes, please reference this issue in the PR. Otherwise, I think this issue is now complete.

  14. jfly commented on Aug 20, 2026

    @jfly
    CollaboratorAuthor

    I'm fine closing this out.

  15. mdaniels5757 commented on Aug 20, 2026

    @mdaniels5757
    Member

    However, I'm not convinced we need to add a release note entry for removing already deprecated attributes. IIUC, release notes should focus on more significant change.

    FYI, I recently documented this: NixOS/nixpkgs@77b21fa

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions