Open jefdaj opened 4 months ago
One thing that appears to help is to rename the final package set as suggested here. I did a few layers of my*
variables so I can be sure to get all the lib functions from them too:
...
# This overlay is weird because it needs to work around a nixpkgs haskell bug:
# https://github.com/NixOS/nixpkgs/issues/235960
# The fix is to expose all new attributes "my*" for now.
# This post pointed me in the right direction:
# https://discourse.nixos.org/t/working-with-haskell-broken-packages/30126/5
haskellOverlay = (final: prev: {
myHaskell = final.lib.recursiveUpdate prev.haskell {
myPackages = final.lib.recursiveUpdate prev.haskell.packages {
myGhc = prev.haskell.packages.${myGhcVersion}.override {
overrides = hFinal: hPrev: {
directory-tree = hFinal.callCabal2nix "directory-tree" directory-tree {};
docopt = prev.haskell.lib.markUnbroken hPrev.docopt;
};
};
};
};
});
...
in myHaskell.myPackages.myGhc.developPackage {
...
modifier = (lib.trivial.flip lib.trivial.pipe) [
addBuildTools
myHaskell.lib.dontHaddock
myHaskell.lib.enableStaticLibraries
myHaskell.lib.justStaticExecutables
myHaskell.lib.disableLibraryProfiling
myHaskell.lib.disableExecutableProfiling
confirmStaticBinaries
];
};
...
So that's good progress!
I have a static build working with a new
flake.nix
based on my old gander one, but when I add any package todevShell
it fails with a message about Docopt being broken:I think this is a manifestation of nixpkgs issue #235960: somehow the non-overridden docopt with
broken = true
is leaking into the final package set. And maybe also being evaluated when it shouldn't be? Will need to do some more detailed investigation.