diff --git a/nix/scope/default.nix b/nix/scope/default.nix index cb3cfdb..3bce205 100644 --- a/nix/scope/default.nix +++ b/nix/scope/default.nix @@ -37,4 +37,6 @@ in mkdir -p $out/packages ''; }; + + lib = callSubPackage ./lib.nix {}; }) diff --git a/nix/scope/lib.nix b/nix/scope/lib.nix new file mode 100644 index 0000000..e5c8e3e --- /dev/null +++ b/nix/scope/lib.nix @@ -0,0 +1,22 @@ +{...}: let + overrideOpamDrv = drv: newArgs: + drv.override (prev: { + mkOpamDerivation = args: prev.mkOpamDerivation (args // newArgs); + }); + + overrideNativeDepends = drv: nativePackages: + overrideOpamDrv drv { + # Disable any guessed native dependencies. + guessedNativeDepends = []; + + # Override the list of native dependencies. + nativeDepends = [ + { + filter = {bool, ...}: bool true; + inherit nativePackages; + } + ]; + }; +in { + inherit overrideOpamDrv overrideNativeDepends; +}