Skip to content

Commit

Permalink
Merge pull request #374 from JonathanLorimer/jonathan/add-nix-shell
Browse files Browse the repository at this point in the history
Add nix-shell and hie.yaml for development purposes
  • Loading branch information
davidsd committed Jul 8, 2023
2 parents f45c9d9 + bf36758 commit 92c97ac
Show file tree
Hide file tree
Showing 4 changed files with 118 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,4 +1,6 @@
dist/
dist-newstyle/
.cabal-sandbox
cabal.sandbox.config
.stack*
stack.yaml.lock
45 changes: 45 additions & 0 deletions flake.lock

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

59 changes: 59 additions & 0 deletions flake.nix
@@ -0,0 +1,59 @@
{
description = ''
This is an implementation of Cloud Haskell, as described in
/Towards Haskell in the Cloud/ by Jeff Epstein, Andrew Black,
and Simon Peyton Jones
(<http://research.microsoft.com/en-us/um/people/simonpj/papers/parallel/>),
although some of the details are different. The precise message
passing semantics are based on /A unified semantics for future Erlang/
by Hans Svensson, Lars-&#xc5;ke Fredlund and Clara Benac Earle.
'';

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
rank1dynamic-src = {
flake = false;
url = "github:haskell-distributed/rank1dynamic/53c5453121592453177370daa06f098cb014c0d3";
};
};

outputs = {
self,
nixpkgs,
rank1dynamic-src
}: let
forAllSystems = function: nixpkgs.lib.genAttrs [ "x86_64-linux" "aarch64-linux" ] (system: function rec {
inherit system;
compilerVersion = "ghc945";
pkgs = nixpkgs.legacyPackages.${system};
hsPkgs = pkgs.haskell.packages.${compilerVersion}.override {
overrides = hfinal: hprev: {
# Internal Packages
distributed-process = hfinal.callCabal2nix "distributed-process" ./. {};

# External Packages
rank1dynamic = hfinal.callCabal2nix "rank1dynamic" rank1dynamic-src {};
};
};
});
in {
formatter = forAllSystems ({pkgs, ...}: pkgs.alejandra);

# nix develop
devShells = forAllSystems ({hsPkgs, pkgs, ...}: {
default = hsPkgs.shellFor {
name = "distributed-process";
packages = p: [
p.distributed-process
];
buildInputs = with pkgs;
[
hsPkgs.haskell-language-server
hsPkgs.cabal-install
cabal2nix
haskellPackages.ghcid
];
};
});
};
}
12 changes: 12 additions & 0 deletions hie.yaml
@@ -0,0 +1,12 @@
cradle:
cabal:
- path: "./src"
component: "lib:distributed-process"
- path: "./benchmark/Latency.hs"
component: "bench:distributed-process-latency"
- path: "./benchmark/Channels.hs"
component: "bench:distributed-process-channels"
- path: "./benchmark/Spawns.hs"
component: "bench:distributed-process-spawns"
- path: "./benchmark/ProcessRing.hs"
component: "bench:distributed-process-ring"

0 comments on commit 92c97ac

Please sign in to comment.