-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add documentation on manually specifying packages option when parsing cabal.project fails #187
Comments
It should be in haskell-flake docs itself ... possibly a |
I would follow those instructions and add how to do this but I'm actually not sure 😆 Going by this from the comment in the scaffolded flake.nix:
leads me to these docs: https://flake.parts/options/haskell-flake.html#opt-perSystem.haskellProjects._name_.defaults.packages And seeing that packages seems to be "lazy attribute set of module" I should be able to follow the packages exmaple from the scaffolded flake.nix:
My guess I haven't been able to test yet is: {
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
};
outputs = inputs@{ self, nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = nixpkgs.lib.systems.flakeExposed;
imports = [ inputs.haskell-flake.flakeModule ];
perSystem = { self', pkgs, ... }: {
haskellProjects.default = {
defaults.packages = {
myproject.source = "0.0.1";
};
};
packages.default = self'.packages.myproject;
};
};
} I'm assuming though that if the cabal.project file can't be parsed there might still be things broken anyway though. |
I think what you want is: perSystem = { self', pkgs, ... }: {
haskellProjects.default = {
defaults.packages = {}; # Disable default packages
packages = {
myproject.source = "0.0.1";
};
};
packages.default = self'.packages.myproject;
}; (Of course you want to use something like |
Ideally I would have been able to search one of the error message texts:
A default value for packages cannot be auto-determined
or
Please specify the
packagesoption manually or change your project configuration (cabal.project).
Perhaps this would belong in https://zero-to-flakes.com/gotchas
The text was updated successfully, but these errors were encountered: