my-project
, and it is relying on a haskell package named some-package
from a nix flake named some-flake
, but I don't know how to make cabal find it correctly, here is my flake:{
inputs = {
some-flake.url = "github:...";
};
outputs = { nixpkgs, some-flake, ... }:
let
project_name = "my-project";
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
eachSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f rec {
inherit system;
pkgs = nixpkgs.legacyPackages.${system};
hpkgs = pkgs.haskell.packages.ghc98;
});
in
rec {
packages = eachSystem ({hpkgs, system, ...}: {
default = hpkgs.callCabal2nix project_name ./. {
some-package = some-flake.packages.${system}.default; #this seems not working
};
});
devShells = eachSystem ({pkgs, hpkgs, system, ...}: {
default = pkgs.haskell.lib.addBuildTools packages.${system}.default
(with hpkgs; [ haskell-language-server cabal-install ]);
});
};
}
Any help?
@LC You want to use the haskell package overlay:
https://nixos.asia/en/nixify-haskell-nixpkgs
which is simpler when using haskell-flake
: https://community.flake.parts/haskell-flake/dependency#path
Last updated: Nov 15 2024 at 13:04 UTC