get working flake

This commit is contained in:
nek0 2022-12-01 19:56:25 +01:00
parent efbb9b4c5e
commit 5bef189c30
2 changed files with 61 additions and 49 deletions

View file

@ -127,12 +127,11 @@ executable example00
ghc-options: -threaded -Wall
default-language: Haskell2010
default-extensions: OverloadedStrings
if flag(examples)
build-depends: base >=4.9 && < 5
, affection
, sdl2 >= 2.5
, stm
else
if !flag(examples)
buildable: False
-- A small game of life implementation
@ -143,7 +142,6 @@ executable example01
ghc-options: -threaded -Wall
default-language: Haskell2010
default-extensions: OverloadedStrings
if flag(examples)
build-depends: base >=4.9 && < 5
, affection
, sdl2 >= 2.5
@ -155,7 +153,7 @@ executable example01
, matrix
, nanovg >= 0.6.0.0
, deepseq
else
if !flag(examples)
buildable: False
-- Another small game of life implementation
@ -166,7 +164,6 @@ executable example02
ghc-options: -threaded -Wall
default-language: Haskell2010
default-extensions: OverloadedStrings
if flag(examples)
build-depends: base >=4.9 && < 5
, affection
, sdl2 >= 2.5
@ -178,5 +175,5 @@ executable example02
, matrix
, nanovg >= 0.6.0.0
, deepseq
else
if !flag(examples)
buildable: False

View file

@ -19,28 +19,43 @@
packageName = "affection";
in rec {
packages.${packageName} = # (ref:haskell-package-def)
haskellPackages.callCabal2nixWithOptions packageName self "--flag examples" rec {
haskellPackages.callCabal2nixWithOptions packageName self "--flag examples" {
# Dependency overrides go here
};
defaultPackage = self.packages.${system}.${packageName};
devShell = defaultPackage.env;
#devShell = pkgs.mkShell {
# buildInputs = with haskellPackages; [
# haskell-language-server
# ghcid
# cabal-install
# ];
# nativeBuildInputs = with pkgs; [
# pkg-config
# glib
# SDL2
# freetype
# glew
# ];
# inputsFrom = builtins.attrValues self.packages.${system};
#};
apps = {
example00 = {
type = "app";
program = "${self.packages.${system}.${packageName}}/bin/example00";
};
example01 = {
type = "app";
program = "${self.packages.${system}.${packageName}}/bin/example01";
};
example02 = {
type = "app";
program = "${self.packages.${system}.${packageName}}/bin/example02";
};
};
#devShell = packages.${packageName}.env;
devShell = pkgs.mkShell {
buildInputs = with haskellPackages; [
haskell-language-server
ghcid
cabal-install
];
nativeBuildInputs = with pkgs; [
pkg-config
glib
SDL2
freetype
glew
];
inputsFrom = builtins.attrValues self.packages.${system};
};
});
}