Use 'overrideCabal', which is much cleaner

This commit is contained in:
Sridhar Ratnakumar 2022-05-17 14:46:28 -04:00
parent 7f9fe62295
commit d65849a193

View file

@ -19,8 +19,6 @@
let let
# Because: https://zimbatm.com/notes/1000-instances-of-nixpkgs # Because: https://zimbatm.com/notes/1000-instances-of-nixpkgs
pkgs = inputs.nixpkgs.legacyPackages.${system}; pkgs = inputs.nixpkgs.legacyPackages.${system};
inherit (pkgs.lib.trivial) pipe flip;
inherit (pkgs.lib.lists) optionals;
# Specify GHC version here. To get the appropriate value, run: # Specify GHC version here. To get the appropriate value, run:
# nix-env -f "<nixpkgs>" -qaP -A haskell.compiler # nix-env -f "<nixpkgs>" -qaP -A haskell.compiler
@ -52,14 +50,12 @@
# Assumes that you have the 'NanoID' flake input defined. # Assumes that you have the 'NanoID' flake input defined.
}; };
modifier = drv: modifier = drv:
let inherit (pkgs.haskell.lib) addBuildTools; pkgs.haskell.lib.overrideCabal drv (oa: {
in # All the Cabal-specific overrides go here.
pipe drv # For examples on what is possible, see:
[ # https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/lib/compose.nix
# Transform the Haskell derivation (`drv`) here. buildTools = (oa.buildTools or [ ]) ++ shellDeps;
(flip addBuildTools });
(optionals returnShellEnv shellDeps))
];
}; };
in in
{ {