Simplify devShell composition using inputsFrom (#99)

This commit is contained in:
Sridhar Ratnakumar 2023-04-08 10:21:13 -04:00 committed by GitHub
parent 60f6d56bb5
commit 7820548927
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 14 deletions

18
flake.lock generated
View file

@ -20,11 +20,11 @@
},
"flake-root": {
"locked": {
"lastModified": 1671378805,
"narHash": "sha256-yqGxyzMN2GuppwG3dTWD1oiKxi+jGYP7D1qUSc5vKhI=",
"lastModified": 1680210152,
"narHash": "sha256-VgFdqsu2i2oUcId9n8BFlRRc4GJHFvrmprdamcSZR1o=",
"owner": "srid",
"repo": "flake-root",
"rev": "dc7ba6166e478804a9da6881aa48c45d300075cf",
"rev": "6000244701c8ae8cf43263564095fd357d89c328",
"type": "github"
},
"original": {
@ -35,11 +35,11 @@
},
"haskell-flake": {
"locked": {
"lastModified": 1679690126,
"narHash": "sha256-u6pQejlTLC1QSKLMB/8Ch+2VvgILlxuZsBHAbDn0zHM=",
"lastModified": 1680963459,
"narHash": "sha256-amqQMQi8D8dACHR717LcZ3X51Vg4UJqHtlQLJbCjV8c=",
"owner": "srid",
"repo": "haskell-flake",
"rev": "d63943b612dbe30e2aba8aab0e60f1011c369973",
"rev": "c74e7c596792e0baf5cd22a9fd0f213e05679b7a",
"type": "github"
},
"original": {
@ -50,11 +50,11 @@
},
"mission-control": {
"locked": {
"lastModified": 1679674077,
"narHash": "sha256-hGz63fsyRGthjE6LLqB08IHApcBvHhI87gWrFN/Uu5w=",
"lastModified": 1680209746,
"narHash": "sha256-P8Q0mPdeo2SvKQUejvl7nOKO2ahIXb6aintYofCxcP8=",
"owner": "Platonic-Systems",
"repo": "mission-control",
"rev": "d07854a616f559370b71c1c440d916ab6869f084",
"rev": "c1bd7344283d4006efb02cc660c5fd9befb73980",
"type": "github"
},
"original": {

View file

@ -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 = {
@ -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
@ -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
];
};
};
};
}