This commit is contained in:
nek0 2022-07-23 17:18:02 +02:00
parent 80581e483f
commit 3358cb8c43
2 changed files with 6 additions and 30 deletions

2
.gitignore vendored
View file

@ -1,3 +1,5 @@
dist/**
dist-newstyle/
.*.swp
.direnv/
.envrc

View file

@ -1,33 +1,7 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }:
{ pkgs ? import <nixpkgs> {}}:
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