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
|
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
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue