diff --git a/.gitignore b/.gitignore index 5a78330..efdcbf7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ dist/** dist-newstyle/ .*.swp +.direnv/ +.envrc diff --git a/shell.nix b/shell.nix index ef5c216..c7a338f 100644 --- a/shell.nix +++ b/shell.nix @@ -1,33 +1,7 @@ -{ nixpkgs ? import {}, compiler ? "default", doBenchmark ? false }: +{ pkgs ? import {}}: let - - inherit (nixpkgs) pkgs; - - f = { mkDerivation, base, deepseq, linear, matrix, monad-loops - , parallel, stdenv, suspend, vector, vty - }: - mkDerivation { - pname = "raycharles"; - version = "0.0.0.0"; - src = ./.; - isLibrary = false; - isExecutable = true; - executableHaskellDepends = [ - base deepseq linear matrix monad-loops parallel suspend vector vty - ]; - description = "A simple raytracer on the Console"; - license = stdenv.lib.licenses.bsd3; - }; - - haskellPackages = if compiler == "default" - then pkgs.haskellPackages - else pkgs.haskell.packages.${compiler}; - - variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id; - - drv = variant (haskellPackages.callPackage f {}); - + raycharles = pkgs.haskellPackages.callCabal2nix "raycharles" (gitignore ./.) {}; + gitignore = dir: pkgs.nix-gitignore.gitignoreSource [] dir; in - - if pkgs.lib.inNixShell then drv.env else drv + raycharles.env