modernize shell.nix

This commit is contained in:
nek0 2022-05-13 16:33:25 +02:00
parent 337fcf9cd0
commit 0c4423c4aa

View file

@ -1,53 +1,16 @@
{ nixpkgs ? import <nixpkgs> {}, compiler ? "default", doBenchmark ? false }: { pkgs ? import <nixpkgs> {}}:
let let
# create a modified haskell package set with my package inside it and broken dependencies
inherit (nixpkgs) pkgs; # jailbroken.
hpkgs = pkgs.haskellPackages.override {
affection = with haskellPackages; callPackage( overrides = hself: hsuper: {
{ mkDerivation, base, bytestring, clock, containers, glib, linear pituicat = hself.callCabal2nix "mateamt" (gitignore ./.) {};
, monad-loops, monad-parallel, mtl, OpenGL, sdl2, stdenv, stm, text affection = hself.callCabal2nix "affection" (gitignore ../affection) {};
, uuid, vector #pg-transact = with pkgs.haskell.lib;
}: # doJailbreak (unmarkBroken (dontCheck hsuper.pg-transact));
mkDerivation { };
pname = "affection"; };
version = "0.0.0.10"; gitignore = dir: pkgs.nix-gitignore.gitignoreSource [] dir;
src = ./extern/affection;
configureFlags = [ "-fverbose" ];
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
base bytestring clock containers glib linear monad-loops
monad-parallel mtl OpenGL sdl2 stm text uuid vector
];
homepage = "https://github.com/nek0/affection#readme";
description = "A simple Game Engine using SDL";
license = pkgs.lib.licenses.lgpl3;
}) {};
f = { mkDerivation, aeson, base, bytestring, containers, derive-storable
, JuicyPixels, JuicyPixels-extra, linear, monad-loops, OpenGL, OpenGLRaw
, stdenv, sdl2, StateVar, stm, text, vector}:
mkDerivation {
pname = "pituicat";
version = "0.0.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [ aeson affection base bytestring containers
derive-storable JuicyPixels JuicyPixels-extra linear monad-loops OpenGL
OpenGLRaw sdl2 StateVar stm text vector];
license = pkgs.lib.licenses.gpl3;
};
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
hpkgs.pituicat.env
if pkgs.lib.inNixShell then drv.env else drv