44 lines
1.2 KiB
Nix
Raw Normal View History

{
# Adds a local Haskell package to the package set, then uses `shellFor`
# so the dev shell follows that package's build inputs.
description = "A Haskell dev shell built with shellFor";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs =
{ self, nixpkgs, ... }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
haskellPackages = pkgs.haskellPackages.override {
overrides = final: _: {
mini-shellfor = final.callCabal2nix "mini-shellfor" ./. { };
};
};
project = haskellPackages.mini-shellfor;
checkedProject = pkgs.haskell.lib.doCheck project;
in
{
packages.${system}.default = project;
apps.${system}.default = {
type = "app";
program = "${self.packages.${system}.default}/bin/mini-shellfor";
meta.description = "Run the shellFor-based Haskell example.";
};
devShells.${system}.default = haskellPackages.shellFor {
packages = hp: [ hp.mini-shellfor ];
nativeBuildInputs = [
pkgs.cabal-install
pkgs.haskell-language-server
];
};
checks.${system}.test-suite = checkedProject;
};
}