@@ -3,25 +3,35 @@ let
3 url = "https://github.com/nixos/nixpkgs/archive/76f2e271a2ef.tar.gz";
3 url = "https://github.com/nixos/nixpkgs/archive/76f2e271a2ef.tar.gz";
4 sha256 = "1r4da3kyghqq7vzya5yb295jpnha1fgp755bi6wda4fmhyaynnsp";
4 sha256 = "1r4da3kyghqq7vzya5yb295jpnha1fgp755bi6wda4fmhyaynnsp";
6− pkgs = import nixpkgsSrc {};
6+ gitignoreSrc = builtins.fetchTarball {
7− gitignoreSrc = pkgs.fetchFromGitHub {
7+ url = "https://github.com/hercules-ci/gitignore/archive/c4662e6.tar.gz";
8− owner = "hercules-ci";
10− # put the latest commit sha of gitignore Nix library here:
12− # use what nix suggests in the mismatch message here:
13− sha256 = "sha256:1npnx0h6bd0d7ql93ka7azhj40zgjp815fw2r6smg8ch9p7mzdlx";
8+ sha256 = "1npnx0h6bd0d7ql93ka7azhj40zgjp815fw2r6smg8ch9p7mzdlx";
15 inherit (import gitignoreSrc { inherit (pkgs); }) gitignoreSource;
10 inherit (import gitignoreSrc { inherit (pkgs); }) gitignoreSource;
17− pkgs.haskellPackages.developPackage {
12+ compiler ? "default",
18− root = gitignoreSource ./.;
13+ pkgs ? import nixpkgsSrc {},
20− modifier = drv:
15+ let
21− pkgs.haskell.lib.addBuildTools drv (with pkgs.haskellPackages;
16+ haskellPackages =
17+ if compiler == "default"
18+ then pkgs.haskellPackages
19+ else pkgs.haskell.packages.${compiler};
21+ haskellPackages.override {
22+ overrides = self: super: with pkgs.haskell.lib; {
23+ jrec = self.callCabal2nix "jrec" (gitignoreSource ./.) {};
27+ projectDrv.shellFor {
28+ packages = p: [ p.jrec ];
29+ buildInputs = with projectDrv; [
22− [ cabal-install
30+ cabal-install
24 haskell-language-server
32 haskell-language-server
37+ if pkgs.lib.inNixShell then projectShell else projectDrv.jrec