From e0710dc8afd7e8e786a72aace9f5b874f099bb4d Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 17 Jan 2026 12:46:58 +0100 Subject: [PATCH 1/5] cabal2nix: remove nix from the wrapper We can almost safely assume that Nix is installed on the system and cabal2nix just needs nix-prefetch-url which is a pretty stable CLI. Removing it from the wrapper prevents situations where we'd pull in Nix when the user actually prefers Lix. There are currently no provisions for dealing with this and overlaying pkgs.nix is (no longer) feasible. There is also no guarantee that daemon protocols are going to stay compatible going forward. --- pkgs/top-level/all-packages.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 04751798c858..e225ab1d43f1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1700,7 +1700,6 @@ with pkgs; wrapProgram $out/bin/cabal2nix \ --prefix PATH ":" "${ lib.makeBinPath [ - nix nix-prefetch-scripts ] }" From aa8111d879c542a370b39587065892b00f01b54f Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 17 Jan 2026 12:49:04 +0100 Subject: [PATCH 2/5] niv: remove pkgs.nix from the wrapper We don't know what Nix implementation the user prefers and niv mostly needs nix-prefetch-url which is stable enough. --- pkgs/development/haskell-modules/configuration-nix.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index a2ff42270836..b5b66ad75f3e 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -262,12 +262,7 @@ builtins.intersectAttrs super { ghc-debug-brick = enableSeparateBinOutput super.ghc-debug-brick; nixfmt = enableSeparateBinOutput super.nixfmt; calligraphy = enableSeparateBinOutput super.calligraphy; - niv = overrideCabal (drv: { - buildTools = (drv.buildTools or [ ]) ++ [ pkgs.buildPackages.makeWrapper ]; - postInstall = '' - wrapProgram ''${!outputBin}/bin/niv --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.nix ]} - ''; - }) (enableSeparateBinOutput (self.generateOptparseApplicativeCompletions [ "niv" ] super.niv)); + niv = enableSeparateBinOutput (self.generateOptparseApplicativeCompletions [ "niv" ] super.niv); ghcid = enableSeparateBinOutput super.ghcid; ormolu = self.generateOptparseApplicativeCompletions [ "ormolu" ] ( enableSeparateBinOutput super.ormolu From dff47de40bd4052ab46042419b40286a8d175424 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 17 Jan 2026 12:49:56 +0100 Subject: [PATCH 3/5] nvfetcher: remove pkgs.nix from the wrapper We don't know what Nix implementation the user prefers and nvfetcher mostly needs nix-prefetch-url which is stable enough. --- pkgs/development/haskell-modules/configuration-nix.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index b5b66ad75f3e..aeb5dc1cfe44 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -1581,7 +1581,6 @@ builtins.intersectAttrs super { wrapProgram "$out/bin/nvfetcher" --prefix 'PATH' ':' "${ pkgs.lib.makeBinPath [ pkgs.nvchecker - pkgs.nix # nix-prefetch-url pkgs.nix-prefetch-git pkgs.nix-prefetch-docker ] From 5b94303f1a37f2c46aeee142e7b34d6880bd64a5 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 17 Jan 2026 12:50:33 +0100 Subject: [PATCH 4/5] update-nix-fetchgit: remove pkgs.nix from the wrapper We can assume that the user has Nix installed. Not having it in the wrapper prevents pulling in a specific version of C++ Nix when the user may prefer another version or Lix etc. --- pkgs/development/haskell-modules/configuration-common.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 1332333c02c5..0a8b59088f37 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1840,7 +1840,6 @@ with haskellLib; # PATH. deps = [ pkgs.git - pkgs.nix pkgs.nix-prefetch-git ]; in @@ -1854,7 +1853,9 @@ with haskellLib; wrapProgram "$out/bin/update-nix-fetchgit" --prefix 'PATH' ':' "${lib.makeBinPath deps}" ''; })) - (addTestToolDepends deps) + # pkgs.nix is not added to the wrapper since we can resonably expect it to be installed + # and we don't know which implementation the eventual user prefers + (addTestToolDepends (deps ++ [ pkgs.nix ])) # Patch for hnix compat. (appendPatches [ (fetchpatch { From a6af5da7f3dbeac24b5cfc8164dba1d11ea51936 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 17 Jan 2026 12:51:53 +0100 Subject: [PATCH 5/5] haskellPackages.cli-nix: note unnecessarily baked in dep on pkgs.nix --- pkgs/development/haskell-modules/configuration-common.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index 0a8b59088f37..1e101cc6073f 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -2025,6 +2025,7 @@ with haskellLib; cli-git = addBuildTool pkgs.git super.cli-git; cli-nix = addBuildTools [ + # Required due to https://github.com/obsidiansystems/cli-nix/issues/11 pkgs.nix pkgs.nix-prefetch-git ] super.cli-nix;