Commit 1110e5fe authored by Robert Hensing's avatar Robert Hensing
Browse files

haskell-modules: Add replacements-by-name

(cherry picked from commit 3ff89d8f)
parent 60b321b6
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
{ pkgs, haskellLib }:

let
  inherit (pkgs) lib;
  inherit (lib.strings) hasSuffix removeSuffix;

  pathsByName =
    lib.concatMapAttrs
      (name: type:
        lib.optionalAttrs (type == "regular" && hasSuffix ".nix" name) {
          ${removeSuffix ".nix" name} = ./replacements-by-name + "/${name}";
        }
      )
      (builtins.readDir ./replacements-by-name);
in

# EXTRA HASKELL PACKAGES NOT ON HACKAGE
#
# This file should only contain packages that are not in ./hackage-packages.nix.
@@ -44,3 +58,4 @@ self: super: {
  hercules-ci-optparse-applicative = self.callPackage ../misc/haskell/hercules-ci-optparse-applicative.nix {};

}
// lib.mapAttrs (_name: path: self.callPackage path {}) pathsByName
+7 −0
Original line number Diff line number Diff line
# haskell-modules/replacements-by-name

This directory is scanned, and all `.nix` files are called in order to replace their respective packages in the `haskellPackages` set.
They're loaded after `hackage-packages.nix` but before any overrides are applied.
See [non-hackage-packages.nix](../non-hackage-packages.nix) for the implementation.

This is used for selective backports of updates, as the hackage package set won't be updated in its entirety.