Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -1857,6 +1857,16 @@ mapAliases {
nix-simple-deploy = throw "'nix-simple-deploy' has been removed as it is broken and unmaintained"; # Added 2024-08-17
nix-universal-prefetch = throw "The nix-universal-prefetch package was dropped since it was unmaintained."; # Added 2024-06-21
nixFlakes = throw "'nixFlakes' has been renamed to/replaced by 'nixVersions.stable'"; # Converted to throw 2024-10-17
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;
Copy link
Contributor

@MattSturgeon MattSturgeon Oct 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should be doing the deprecation (i.e. step 2) at the underlying haskellPackages.nixfmt package? Since the top-level nixfmt-classic is already just an alias for it...

I can't see if/how/where the haskellPackages set handles aliases and deprecation, though... Nothing obvious in the entrypoint. Maybe @NixOS/haskell will know?

Whatever we do should be gated behind config.allowAliases, of course.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be implemented manually, you can grep for allowAliases. Note that package removal is currently not possible (in a sensible way), but will probably be implemented sometime this autumn (cc @wolfgangwalther).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I spoke to @wolfgangwalther async:

haskell packages are auto-generated. You can't add aliases. You can only do this at the source once #441204 is done, by removing the package from haskellPackages. For now you need to alias it on the top-level only.

So I believe the correct thing to do is merge this as-is, then move the deprecation into the haskellPackages scope if/when that package-set adds support for deprecating specific packages.

Naïvely, we could add an overlay to the end of haskellPackages's extensions stack, and have that overlay implement the deprecations:

(final: prev: lib.optionalAttrs final.config.allowAliases {
  nixfmt =
    (
      if lib.oldestSupportedReleaseIsAtLeast 2605 then
        throw "haskellPackages.nixfmt has been removed as it is deprecated and unmaintained."
      else if lib.oldestSupportedReleaseIsAtLeast 2511 then
        lib.warnOnInstantiate "haskellPackages.nixfmt is deprecated and unmaintained. We recommend switching to nixfmt."
      else
        lib.id
    )
      prev.nixfmt;
})

However, this means that the package will still be present without any deprecation when allowAliases = false, which is unusual. That's because the package is automatically generated from hackage, so we can't move its base definition to a conditional extension.

nixStable = nixVersions.stable; # Added 2022-01-24
nixUnstable = throw "nixUnstable has been removed. For bleeding edge (Nix master, roughly weekly updated) use nixVersions.git, otherwise use nixVersions.latest."; # Converted to throw 2024-04-22
nix_2_3 = throw "'nix_2_3' has been removed, because it was unmaintained and insecure."; # Converted to throw 2025-07-24
Expand Down
2 changes: 0 additions & 2 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14840,8 +14840,6 @@ with pkgs;

nix-visualize = python3.pkgs.callPackage ../tools/package-management/nix-visualize { };

nixfmt-classic = haskellPackages.nixfmt.bin;

nixpkgs-manual = callPackage ../../doc/doc-support/package.nix { };

nixos-artwork = callPackage ../data/misc/nixos-artwork { };
Expand Down
Loading