Use 'overrideCabal', which is much cleaner
This commit is contained in:
parent
7f9fe62295
commit
d65849a193
1 changed files with 6 additions and 10 deletions
16
flake.nix
16
flake.nix
|
@ -19,8 +19,6 @@
|
|||
let
|
||||
# Because: https://zimbatm.com/notes/1000-instances-of-nixpkgs
|
||||
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:
|
||||
# nix-env -f "<nixpkgs>" -qaP -A haskell.compiler
|
||||
|
@ -52,14 +50,12 @@
|
|||
# Assumes that you have the 'NanoID' flake input defined.
|
||||
};
|
||||
modifier = drv:
|
||||
let inherit (pkgs.haskell.lib) addBuildTools;
|
||||
in
|
||||
pipe drv
|
||||
[
|
||||
# Transform the Haskell derivation (`drv`) here.
|
||||
(flip addBuildTools
|
||||
(optionals returnShellEnv shellDeps))
|
||||
];
|
||||
pkgs.haskell.lib.overrideCabal drv (oa: {
|
||||
# All the Cabal-specific overrides go here.
|
||||
# For examples on what is possible, see:
|
||||
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/lib/compose.nix
|
||||
buildTools = (oa.buildTools or [ ]) ++ shellDeps;
|
||||
});
|
||||
};
|
||||
in
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue