From fc3668a3ab9fe6d2f67a041f1d7f7bd955636b06 Mon Sep 17 00:00:00 2001 From: maralorn Date: Sat, 10 Jun 2023 14:18:49 +0200 Subject: [PATCH] haskellPackages: Use separate bin output for multiple packages --- doc/languages-frameworks/haskell.section.md | 2 +- nixos/doc/manual/release-notes/rl-2311.section.md | 3 +++ pkgs/development/haskell-modules/configuration-nix.nix | 7 +++++++ pkgs/top-level/all-packages.nix | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/doc/languages-frameworks/haskell.section.md b/doc/languages-frameworks/haskell.section.md index 87da2e63663a..e3b4327bdb29 100644 --- a/doc/languages-frameworks/haskell.section.md +++ b/doc/languages-frameworks/haskell.section.md @@ -23,7 +23,7 @@ installing and using them. All of these packages are originally defined in the `haskellPackages` package set and are re-exposed with a reduced dependency closure for convenience. -(see `justStaticExecutables` below) +(see `justStaticExecutables` or `separateBinOutput` below) The `haskellPackages` set includes at least one version of every package from Hackage as well as some manually injected packages. This amounts to a lot of diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md index bc10f5b587c7..003ada19f22e 100644 --- a/nixos/doc/manual/release-notes/rl-2311.section.md +++ b/nixos/doc/manual/release-notes/rl-2311.section.md @@ -36,6 +36,9 @@ - `fileSystems..autoResize` now uses `systemd-growfs` to resize the file system online in stage 2. This means that `f2fs` and `ext2` can no longer be auto resized, while `xfs` and `btrfs` now can be. +- The following packages in `haskellPackages` have now a separate bin output: `cabal-fmt`, `calligraphy`, `eventlog2html`, `ghc-debug-brick`, `hindent`, `nixfmt`, `releaser`. This means you need to replace e.g. `"${pkgs.haskellPackages.nixfmt}/bin/nixfmt"` with `"${lib.getBin pkgs.haskellPackages.nixfmt}/bin/nixfmt"` or `"${lib.getExe pkgs.haskellPackages.nixfmt}"`. The binaries also won’t be in scope if you rely on them being installed e.g. via `ghcWithPackages`. `environment.packages` picks the `bin` output automatically, so for normal installation no intervention is required. Also, toplevel attributes like `pkgs.nixfmt` are not impacted negatively by this change. + + ## Other Notable Changes {#sec-release-23.11-notable-changes} - The Cinnamon module now enables XDG desktop integration by default. If you are experiencing collisions related to xdg-desktop-portal-gtk you can safely remove `xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];` from your NixOS configuration. diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index 9624b28e1159..de924376c8dc 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -281,6 +281,13 @@ self: super: builtins.intersectAttrs super { sfml-audio = appendConfigureFlag "--extra-include-dirs=${pkgs.openal}/include/AL" super.sfml-audio; # avoid compiling twice by providing executable as a separate output (with small closure size) + cabal-fmt = enableSeparateBinOutput super.cabal-fmt; + hindent = enableSeparateBinOutput super.hindent; + releaser = enableSeparateBinOutput super.releaser; + eventlog2html = enableSeparateBinOutput super.eventlog2html; + ghc-debug-brick = enableSeparateBinOutput super.ghc-debug-brick; + nixfmt = enableSeparateBinOutput super.nixfmt; + calligraphy = enableSeparateBinOutput super.calligraphy; niv = enableSeparateBinOutput (self.generateOptparseApplicativeCompletions [ "niv" ] super.niv); ghcid = enableSeparateBinOutput super.ghcid; ormolu = self.generateOptparseApplicativeCompletions [ "ormolu" ] (enableSeparateBinOutput super.ormolu); diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c67d4fb18d51..71318c8fa786 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -39530,7 +39530,7 @@ with pkgs; alejandra = callPackage ../tools/nix/alejandra { }; - nixfmt = haskell.lib.compose.justStaticExecutables haskellPackages.nixfmt; + nixfmt = haskellPackages.nixfmt.bin; nixpkgs-fmt = callPackage ../tools/nix/nixpkgs-fmt { };