Skip to content
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

Simplify devShell composition using inputsFrom #99

Merged
merged 5 commits into from
Apr 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 14 additions & 5 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
inputs.mission-control.flakeModule
];
perSystem = { self', system, lib, config, pkgs, ... }: {
# The "main" project. You can have multiple projects, but this template
# Our only Haskell project. You can have multiple projects, but this template
# has only one.
haskellProjects.main = {
# See https://github.com/srid/haskell-flake/blob/master/example/flake.nix
haskellProjects.default = {
# packages.haskell-template.root = ./.; # Auto-discovered by haskell-flake
overrides = self: super: { };
devShell = {
Expand All @@ -31,6 +32,7 @@
} // config.treefmt.build.programs;
hlsCheck.enable = true;
};
autoWire = false; # Enables us to wire flake outputs manually.
};

# Auto formatters. This also adds a flake check to ensure that the
Expand Down Expand Up @@ -87,11 +89,18 @@
};

# Default package.
packages.default = self'.packages.main-haskell-template;
packages.default = config.haskellProjects.default.outputs.localPackages.haskell-template;

checks = config.haskellProjects.default.outputs.checks;

# Default shell.
devShells.default =
config.mission-control.installToDevShell self'.devShells.main;
devShells.default = pkgs.mkShell {
inputsFrom = [
config.haskellProjects.default.outputs.devShell
config.flake-root.devShell
config.mission-control.devShell
];
};
};
};
}