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/**
dist-newstyle/ dist-newstyle/
.*.swp .*.swp
.direnv/
.envrc

View file

@ -1,33 +1,7 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }: { pkgs ? import <nixpkgs> {}}:
let let
raycharles = pkgs.haskellPackages.callCabal2nix "raycharles" (gitignore ./.) {};
inherit (nixpkgs) pkgs; gitignore = dir: pkgs.nix-gitignore.gitignoreSource [] dir;
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 {});
in in
raycharles.env
if pkgs.lib.inNixShell then drv.env else drv