Skip to content

Commit

Permalink
haskell-modules: Add replacements-by-name
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Jun 12, 2024
1 parent eb821a7 commit 3ff89d8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkgs/development/haskell-modules/non-hackage-packages.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
{ 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.
Expand Down Expand Up @@ -42,3 +56,4 @@ self: super: {
hercules-ci-optparse-applicative = self.callPackage ../misc/haskell/hercules-ci-optparse-applicative.nix {};

}
// lib.mapAttrs (_name: path: self.callPackage path {}) pathsByName
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 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.

0 comments on commit 3ff89d8

Please sign in to comment.