-
Hello there! I'm trying to set Here is my {
inputs = {
# ...
haskell-flake.url = "github:srid/haskell-flake";
# ...
};
outputs = inp@{flake-parts, ...} : flake-parts.lib.mkFlake { inputs = inp; } ({config, ... } : let
conf = config;
in {
systems = [ "x86_64-linux"];
imports = [
inp.haskell-flake.flakeModule
# ...
];
flake = {
haskellFlakeProjectModules.default = { pkgs, config, ... }: {
defaults.enable = true;
defaults.packages = {
eta-common = {
source = ./common;
local.toCurrentProject = true;
local.toDefinedProject = true;
};
eta-frontend = {
source = ./frontend;
local.toCurrentProject = true;
local.toDefinedProject = true;
};
};
# ...
devShell = {
hlsCheck.enable = false;
};
# What should haskell-flake add to flake outputs?
autoWire = [ "packages" "apps" "checks" ]; # Wire all but the devShell
};
};
perSystem = { self', system, lib, config, pkgs, ... }: {
haskellProjects.default = {
imports = [
conf.flake.haskellFlakeProjectModules.default
];
defaults.packages = {
eta-backend = {
source = ./backend;
local.toCurrentProject = true;
local.toDefinedProject = true;
};
};
defaults.devShell.tools = hp: with hp; {
inherit
haskell-language-server;
};
basePackages = pkgs.haskell.packages.ghc983;
# ...
# Does not take effect
autoWire = [ "packages" "apps" "checks" ];
};
haskellProjects.ghcjs = {
imports = [
conf.flake.haskellFlakeProjectModules.default
];
basePackages = pkgs.pkgsCross.ghcjs.haskell.packages.ghc983;
autoWire = [];
# ...
};
# Needed, because `autoWire` does not work
# `packages` is empty here, but `finalPackages` contains the needed packages
packages.default = config.haskellProjects.default.outputs.finalPackages.eta-backend;
packages.frontend = config.haskellProjects.default.outputs.finalPackages.eta-frontend;
# `autoWire` is disabled for ghcjs
packages.frontendJS = config.haskellProjects.ghcjs.outputs.finalPackages.eta-frontend;
# apps here is empty
apps = config.haskellProjects.default.outputs.apps;
# ...
};
});
} I've tried to go over the source code, but I was unable to pinpoint where the problem occurs. I've read in the discussions that I should use I'm aware that I could use a Thank you in advance for your help, and for your work on this great module! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 10 replies
-
Sounds like you want to use multiple projects, as in: autowiring is mostly meant to provide automatic defaults. So I suggest explicitly specifying the package lists as you do. |
Beta Was this translation helpful? Give feedback.
Okay, I see the problem. You need to use
self
to refer to the local path. With this,autowire = ["packages"]
should also work, obviating from manually wiring the packages yourself.