Skip to content

Commit

Permalink
Add Nix flake
Browse files Browse the repository at this point in the history
  • Loading branch information
vapourismo committed Jan 2, 2022
1 parent 67b91ab commit 87cc713
Show file tree
Hide file tree
Showing 2 changed files with 88 additions and 0 deletions.
41 changes: 41 additions & 0 deletions flake.lock

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

47 changes: 47 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
description = "Simple pool implementation";

inputs = {
flake-utils.url = github:numtide/flake-utils;
};

outputs = { self, nixpkgs, flake-utils }: {
overlay = final: prev: {
haskell = prev.haskell.override {
packageOverrides = final: prev: {
simpoole = prev.callCabal2nix "simpoole" self { };
};
};
};
} // flake-utils.lib.eachDefaultSystem (system:
with (import nixpkgs {
inherit system;
config = { overlays = [ self.overlay ]; };
});

{
packages = {
simpoole = haskellPackages.simpoole;
};

defaultPackage = self.packages.${system}.simpoole;

checks = {
simpoole = self.packages.${system}.simpoole.overrideAttrs (_: { doCheck = true; });
};

devShell = mkShell {
buildInputs = [
(haskellPackages.ghcWithPackages (hspkgs:
hspkgs.simpoole.propagatedBuildInputs ++ hspkgs.simpoole.buildInputs
))
cabal-install
haskell-language-server
hlint
stylish-haskell
nixpkgs-fmt
];
};
}
);
}

0 comments on commit 87cc713

Please sign in to comment.