How do you add a dependency coming from another flake?
I have library’s flake defined as followed:
{
description = "adhoc-fixtures";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
yarl.url = "github:blackheaven/yarl";
};
outputs = inputs@{ self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
haskellPackages = pkgs.haskell.packages.ghc924.override {
overrides = hself: hsuper: {
yarl = hself.callCabal2nix "yarl" inputs.yarl { };
};
};
in
rec
{
packages.adhoc-fixtures =
(haskellPackages.callCabal2nix "adhoc-fixtures" ./. rec {
# Dependency overrides go here
});
defaultPackage = packages.adhoc-fixtures;
devShell =
pkgs.mkShell {
buildInputs = with haskellPackages; [
haskell-language-server
ghcid
cabal-install
haskell-ci
];
inputsFrom = [
self.defaultPackage.${system}.env
];
};
});
}
See the full project.
I’m force to set yarl
because it’s not in the snapshot, however it does not seem to work:
error: 'outputs' at /nix/store/3r0cr3cc9swjc02a40qy2cg5z6rq383i-source/flake.nix:10:13 called with unexpected argument 'yarl'
at «string»:45:21:
44|
45| outputs = flake.outputs (inputs // { self = result; });
| ^
46|
how can I set it properly?
Thanks in advance.