*clank* *rattle* *boing*
This commit is contained in:
parent
537377bd94
commit
463afc7842
12 changed files with 734 additions and 12 deletions
165
.plan.nix/affection.nix
Normal file
165
.plan.nix/affection.nix
Normal file
|
@ -0,0 +1,165 @@
|
|||
let
|
||||
buildDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (build dependency).
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
sysDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Nixpkgs package set does not contain the package: ${pkg} (system dependency).
|
||||
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
pkgConfDepError = pkg:
|
||||
builtins.throw ''
|
||||
The pkg-conf packages does not contain the package: ${pkg} (pkg-conf dependency).
|
||||
|
||||
You may need to augment the pkg-conf package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
exeDepError = pkg:
|
||||
builtins.throw ''
|
||||
The local executable components do not include the component: ${pkg} (executable dependency).
|
||||
'';
|
||||
legacyExeDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (executable dependency).
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
buildToolDepError = pkg:
|
||||
builtins.throw ''
|
||||
Neither the Haskell package set or the Nixpkgs package set contain the package: ${pkg} (build tool dependency).
|
||||
|
||||
If this is a system dependency:
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
|
||||
If this is a Haskell dependency:
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
in { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }:
|
||||
{
|
||||
flags = {
|
||||
verbose = false;
|
||||
debug = false;
|
||||
warn = false;
|
||||
error = false;
|
||||
examples = false;
|
||||
};
|
||||
package = {
|
||||
specVersion = "1.10";
|
||||
identifier = { name = "affection"; version = "0.0.0.9"; };
|
||||
license = "LGPL-3.0-only";
|
||||
copyright = "";
|
||||
maintainer = "nek0@chelnok.de";
|
||||
author = "nek0";
|
||||
homepage = "https://github.com/nek0/affection#readme";
|
||||
url = "";
|
||||
synopsis = "A simple Game Engine using SDL";
|
||||
description = "This package contains Affection, a simple game engine\nwritten in Haskell using SDL.\nThis Engine is still work in progress and even minor\nversion bumps may contain breaking api changes.";
|
||||
buildType = "Simple";
|
||||
isLocal = true;
|
||||
detailLevel = "FullDetails";
|
||||
licenseFiles = [ "LICENSE" ];
|
||||
dataDir = "";
|
||||
dataFiles = [];
|
||||
extraSrcFiles = [ "ChangeLog.md" ];
|
||||
extraTmpFiles = [];
|
||||
extraDocFiles = [];
|
||||
};
|
||||
components = {
|
||||
"library" = {
|
||||
depends = [
|
||||
(hsPkgs."base" or (buildDepError "base"))
|
||||
(hsPkgs."sdl2" or (buildDepError "sdl2"))
|
||||
(hsPkgs."linear" or (buildDepError "linear"))
|
||||
(hsPkgs."text" or (buildDepError "text"))
|
||||
(hsPkgs."mtl" or (buildDepError "mtl"))
|
||||
(hsPkgs."monad-loops" or (buildDepError "monad-loops"))
|
||||
(hsPkgs."monad-parallel" or (buildDepError "monad-parallel"))
|
||||
(hsPkgs."containers" or (buildDepError "containers"))
|
||||
(hsPkgs."clock" or (buildDepError "clock"))
|
||||
(hsPkgs."glib" or (buildDepError "glib"))
|
||||
(hsPkgs."bytestring" or (buildDepError "bytestring"))
|
||||
(hsPkgs."OpenGL" or (buildDepError "OpenGL"))
|
||||
(hsPkgs."stm" or (buildDepError "stm"))
|
||||
(hsPkgs."uuid" or (buildDepError "uuid"))
|
||||
(hsPkgs."vector" or (buildDepError "vector"))
|
||||
];
|
||||
buildable = true;
|
||||
modules = [
|
||||
"Affection"
|
||||
"Affection/Logging"
|
||||
"Affection/Types"
|
||||
"Affection/StateMachine"
|
||||
"Affection/Util"
|
||||
"Affection/MessageBus"
|
||||
"Affection/MessageBus/Class"
|
||||
"Affection/MessageBus/Message"
|
||||
"Affection/MessageBus/Message/Class"
|
||||
"Affection/MessageBus/Message/WindowMessage"
|
||||
"Affection/MessageBus/Message/KeyboardMessage"
|
||||
"Affection/MessageBus/Message/MouseMessage"
|
||||
"Affection/MessageBus/Message/JoystickMessage"
|
||||
"Affection/Subsystems"
|
||||
"Affection/Subsystems/Class"
|
||||
"Affection/Subsystems/AffectionWindow"
|
||||
"Affection/Subsystems/AffectionKeyboard"
|
||||
"Affection/Subsystems/AffectionMouse"
|
||||
"Affection/Subsystems/AffectionJoystick"
|
||||
];
|
||||
hsSourceDirs = [ "src" ];
|
||||
};
|
||||
exes = {
|
||||
"example00" = {
|
||||
depends = (pkgs.lib).optionals (flags.examples) [
|
||||
(hsPkgs."base" or (buildDepError "base"))
|
||||
(hsPkgs."affection" or (buildDepError "affection"))
|
||||
(hsPkgs."sdl2" or (buildDepError "sdl2"))
|
||||
(hsPkgs."stm" or (buildDepError "stm"))
|
||||
];
|
||||
buildable = if flags.examples then true else false;
|
||||
hsSourceDirs = [ "examples/example00" ];
|
||||
mainPath = [ "Main.hs" ] ++ [ "" ];
|
||||
};
|
||||
"example01" = {
|
||||
depends = (pkgs.lib).optionals (flags.examples) [
|
||||
(hsPkgs."base" or (buildDepError "base"))
|
||||
(hsPkgs."affection" or (buildDepError "affection"))
|
||||
(hsPkgs."sdl2" or (buildDepError "sdl2"))
|
||||
(hsPkgs."stm" or (buildDepError "stm"))
|
||||
(hsPkgs."OpenGL" or (buildDepError "OpenGL"))
|
||||
(hsPkgs."random" or (buildDepError "random"))
|
||||
(hsPkgs."containers" or (buildDepError "containers"))
|
||||
(hsPkgs."linear" or (buildDepError "linear"))
|
||||
(hsPkgs."matrix" or (buildDepError "matrix"))
|
||||
(hsPkgs."nanovg" or (buildDepError "nanovg"))
|
||||
(hsPkgs."deepseq" or (buildDepError "deepseq"))
|
||||
];
|
||||
buildable = if flags.examples then true else false;
|
||||
modules = [ "Types" ];
|
||||
hsSourceDirs = [ "examples/example01" ];
|
||||
mainPath = [ "Main.hs" ] ++ [ "" ];
|
||||
};
|
||||
"example02" = {
|
||||
depends = (pkgs.lib).optionals (flags.examples) [
|
||||
(hsPkgs."base" or (buildDepError "base"))
|
||||
(hsPkgs."affection" or (buildDepError "affection"))
|
||||
(hsPkgs."sdl2" or (buildDepError "sdl2"))
|
||||
(hsPkgs."stm" or (buildDepError "stm"))
|
||||
(hsPkgs."OpenGL" or (buildDepError "OpenGL"))
|
||||
(hsPkgs."random" or (buildDepError "random"))
|
||||
(hsPkgs."containers" or (buildDepError "containers"))
|
||||
(hsPkgs."linear" or (buildDepError "linear"))
|
||||
(hsPkgs."matrix" or (buildDepError "matrix"))
|
||||
(hsPkgs."nanovg" or (buildDepError "nanovg"))
|
||||
(hsPkgs."deepseq" or (buildDepError "deepseq"))
|
||||
];
|
||||
buildable = if flags.examples then true else false;
|
||||
modules = [ "Types" ];
|
||||
hsSourceDirs = [ "examples/example02" ];
|
||||
mainPath = [ "Main.hs" ] ++ [ "" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
} // rec { src = (pkgs.lib).mkDefault ../../affection; }
|
81
.plan.nix/canvas.nix
Normal file
81
.plan.nix/canvas.nix
Normal file
|
@ -0,0 +1,81 @@
|
|||
let
|
||||
buildDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (build dependency).
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
sysDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Nixpkgs package set does not contain the package: ${pkg} (system dependency).
|
||||
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
pkgConfDepError = pkg:
|
||||
builtins.throw ''
|
||||
The pkg-conf packages does not contain the package: ${pkg} (pkg-conf dependency).
|
||||
|
||||
You may need to augment the pkg-conf package mapping in haskell.nix so that it can be found.
|
||||
'';
|
||||
exeDepError = pkg:
|
||||
builtins.throw ''
|
||||
The local executable components do not include the component: ${pkg} (executable dependency).
|
||||
'';
|
||||
legacyExeDepError = pkg:
|
||||
builtins.throw ''
|
||||
The Haskell package set does not contain the package: ${pkg} (executable dependency).
|
||||
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
buildToolDepError = pkg:
|
||||
builtins.throw ''
|
||||
Neither the Haskell package set or the Nixpkgs package set contain the package: ${pkg} (build tool dependency).
|
||||
|
||||
If this is a system dependency:
|
||||
You may need to augment the system package mapping in haskell.nix so that it can be found.
|
||||
|
||||
If this is a Haskell dependency:
|
||||
If you are using Stackage, make sure that you are using a snapshot that contains the package. Otherwise you may need to update the Hackage snapshot you are using, usually by updating haskell.nix.
|
||||
'';
|
||||
in { system, compiler, flags, pkgs, hsPkgs, pkgconfPkgs, ... }:
|
||||
{
|
||||
flags = {};
|
||||
package = {
|
||||
specVersion = "2.4";
|
||||
identifier = { name = "canvas"; version = "0.0.0.0"; };
|
||||
license = "BSD-3-Clause";
|
||||
copyright = "";
|
||||
maintainer = "nek0@nek0.eu";
|
||||
author = "nek0";
|
||||
homepage = "";
|
||||
url = "";
|
||||
synopsis = "A test implementation for drawing images with SDL2 and OpenGL";
|
||||
description = "";
|
||||
buildType = "Simple";
|
||||
isLocal = true;
|
||||
detailLevel = "FullDetails";
|
||||
licenseFiles = [ "LICENSE" ];
|
||||
dataDir = "";
|
||||
dataFiles = [];
|
||||
extraSrcFiles = [ "CHANGELOG.md" ];
|
||||
extraTmpFiles = [];
|
||||
extraDocFiles = [];
|
||||
};
|
||||
components = {
|
||||
exes = {
|
||||
"canvas" = {
|
||||
depends = [
|
||||
(hsPkgs."base" or (buildDepError "base"))
|
||||
(hsPkgs."affection" or (buildDepError "affection"))
|
||||
(hsPkgs."sdl2" or (buildDepError "sdl2"))
|
||||
(hsPkgs."OpenGL" or (buildDepError "OpenGL"))
|
||||
(hsPkgs."JuicyPixels" or (buildDepError "JuicyPixels"))
|
||||
(hsPkgs."JuicyPixels-extra" or (buildDepError "JuicyPixels-extra"))
|
||||
];
|
||||
buildable = true;
|
||||
hsSourceDirs = [ "app" ];
|
||||
mainPath = [ "Main.hs" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
} // rec { src = (pkgs.lib).mkDefault ../.; }
|
|
@ -1,4 +1,10 @@
|
|||
module Main where
|
||||
|
||||
import Affection
|
||||
|
||||
-- internal imports
|
||||
|
||||
import Types
|
||||
|
||||
main :: IO ()
|
||||
main = putStrLn "Hello, Haskell!"
|
||||
|
|
5
app/Types.hs
Normal file
5
app/Types.hs
Normal file
|
@ -0,0 +1,5 @@
|
|||
module Types
|
||||
( module T
|
||||
) where
|
||||
|
||||
import Types.UserData as T
|
14
app/Types/UserData.hs
Normal file
14
app/Types/UserData.hs
Normal file
|
@ -0,0 +1,14 @@
|
|||
module Types.UserData where
|
||||
|
||||
import Affection
|
||||
|
||||
import Control.Concurrent.STM
|
||||
|
||||
import qualified SDL
|
||||
|
||||
import qualified Data.Map.Strict as M
|
||||
|
||||
data UserData = UserData
|
||||
{ udSubsystems = Subsystems
|
||||
, udAssetImages = M.Map ImgId Image
|
||||
}
|
3
cabal.project
Normal file
3
cabal.project
Normal file
|
@ -0,0 +1,3 @@
|
|||
packages:
|
||||
./
|
||||
../affection
|
|
@ -20,5 +20,11 @@ executable canvas
|
|||
-- other-modules:
|
||||
-- other-extensions:
|
||||
build-depends: base ^>=4.12.0.0
|
||||
, affection
|
||||
, sdl2 ^>=2.5.0.0
|
||||
, OpenGL
|
||||
, JuicyPixels
|
||||
, JuicyPixels-extra
|
||||
, stm
|
||||
hs-source-dirs: app
|
||||
default-language: Haskell2010
|
||||
|
|
45
default.nix
45
default.nix
|
@ -1,11 +1,34 @@
|
|||
{ pkgs ? import <nixpkgs> (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz))
|
||||
, haskellCompiler ? "ghc865"
|
||||
, lib ? pkgs.lib
|
||||
, config ? pkgs.config
|
||||
}:
|
||||
pkgs.haskell-nix.cabalProject {
|
||||
src = pkgs.haskell-nix.haskellLib.cleanGit { src = ./.; };
|
||||
#src = pkgs.haskell-nix.haskellLib.cleanGit { src = pkgs.nix-gitignore.gitignoreSource [] ./.; };
|
||||
#rc = pkgs.nix-gitignore.gitignoreSource [] ./.;
|
||||
ghc = pkgs.buildPackages.pkgs.haskell-nix.compiler.${haskellCompiler};
|
||||
}
|
||||
let
|
||||
# import niv packages
|
||||
sources = import ./nix/sources.nix;
|
||||
overlay = _: pkgs:
|
||||
{ niv = import sources.niv {}; # use the sources :)
|
||||
};
|
||||
|
||||
# Import the Haskell.nix library,
|
||||
#pkgs = import <nixpkgs> (import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz));
|
||||
pkgs = import sources.nixpkgs (
|
||||
overlays = [ overlay ];
|
||||
config = {};
|
||||
import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz)
|
||||
);
|
||||
|
||||
# Import the file you will create in the stack-to-nix or cabal-to-nix step.
|
||||
my-pkgs = import ./pkgs.nix;
|
||||
|
||||
# Cabal projects use this:
|
||||
pkgSet = pkgs.haskell-nix.mkCabalProjectPkgSet {
|
||||
plan-pkgs = my-pkgs;
|
||||
pkg-def-extras = [];
|
||||
modules = [
|
||||
# specific package overrides would go here
|
||||
# example:
|
||||
# packages.cbors.package.ghcOptions = "-Werror";
|
||||
# packages.cbors.patches = [ ./one.patch ];
|
||||
# packages.cbors.flags.optimize-gmp = false;
|
||||
# It may be better to set flags in `cabal.project` instead
|
||||
# (`plan-to-nix` will include them as defaults).
|
||||
];
|
||||
};
|
||||
|
||||
in pkgSet.config.hsPkgs // { _config = pkgSet.config; }
|
||||
|
|
45
nix/sources.json
Normal file
45
nix/sources.json
Normal file
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"affection": {
|
||||
"branch": "master",
|
||||
"description": "A simple Game Engine in Haskell using SDL",
|
||||
"homepage": "",
|
||||
"owner": "nek0",
|
||||
"repo": "affection",
|
||||
"rev": "18775515d8d569c36148c02a134e1f538981b1ff",
|
||||
"sha256": "09bxf917mj1lanc0d5f7xj3n22dk8drzgqivqpnvskdx88pmrv4k",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/nek0/affection/archive/18775515d8d569c36148c02a134e1f538981b1ff.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
},
|
||||
"ghc": {
|
||||
"sha256": "1pqlx6rdjs2110g0y1i9f8x18lmdizibjqd15f5xahcz39hgaxdw",
|
||||
"type": "file",
|
||||
"url": "https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-deb9-linux.tar.xz",
|
||||
"url_template": "https://downloads.haskell.org/~ghc/<version>/ghc-<version>-x86_64-deb9-linux.tar.xz",
|
||||
"version": "8.6.5"
|
||||
},
|
||||
"niv": {
|
||||
"branch": "master",
|
||||
"description": "Easy dependency management for Nix projects",
|
||||
"homepage": "https://github.com/nmattia/niv",
|
||||
"owner": "nmattia",
|
||||
"repo": "niv",
|
||||
"rev": "7a21f49027c0901456acd6e61d91bd9e3b15b1f6",
|
||||
"sha256": "1hrcjgz4ib5n6wm96gcjk2qjl03pvspksk48b2lkn29vpdry98jm",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/nmattia/niv/archive/7a21f49027c0901456acd6e61d91bd9e3b15b1f6.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
},
|
||||
"nixpkgs": {
|
||||
"branch": "nixos-19.09",
|
||||
"description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
|
||||
"homepage": "https://github.com/NixOS/nixpkgs",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs-channels",
|
||||
"rev": "d3d2de8b99be56c5a6ed18f46e280f8103124dd7",
|
||||
"sha256": "1chzbajrspw24csnv2c0h1h59pbp1k6939cllmd61382p9iw7rg8",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/NixOS/nixpkgs-channels/archive/d3d2de8b99be56c5a6ed18f46e280f8103124dd7.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
}
|
||||
}
|
134
nix/sources.nix
Normal file
134
nix/sources.nix
Normal file
|
@ -0,0 +1,134 @@
|
|||
# This file has been generated by Niv.
|
||||
|
||||
let
|
||||
|
||||
#
|
||||
# The fetchers. fetch_<type> fetches specs of type <type>.
|
||||
#
|
||||
|
||||
fetch_file = pkgs: spec:
|
||||
if spec.builtin or true then
|
||||
builtins_fetchurl { inherit (spec) url sha256; }
|
||||
else
|
||||
pkgs.fetchurl { inherit (spec) url sha256; };
|
||||
|
||||
fetch_tarball = pkgs: spec:
|
||||
if spec.builtin or true then
|
||||
builtins_fetchTarball { inherit (spec) url sha256; }
|
||||
else
|
||||
pkgs.fetchzip { inherit (spec) url sha256; };
|
||||
|
||||
fetch_git = spec:
|
||||
builtins.fetchGit { url = spec.repo; inherit (spec) rev ref; };
|
||||
|
||||
fetch_builtin-tarball = spec:
|
||||
builtins.trace
|
||||
''
|
||||
WARNING:
|
||||
The niv type "builtin-tarball" will soon be deprecated. You should
|
||||
instead use `builtin = true`.
|
||||
|
||||
$ niv modify <package> -a type=tarball -a builtin=true
|
||||
''
|
||||
builtins_fetchTarball { inherit (spec) url sha256; };
|
||||
|
||||
fetch_builtin-url = spec:
|
||||
builtins.trace
|
||||
''
|
||||
WARNING:
|
||||
The niv type "builtin-url" will soon be deprecated. You should
|
||||
instead use `builtin = true`.
|
||||
|
||||
$ niv modify <package> -a type=file -a builtin=true
|
||||
''
|
||||
(builtins_fetchurl { inherit (spec) url sha256; });
|
||||
|
||||
#
|
||||
# Various helpers
|
||||
#
|
||||
|
||||
# The set of packages used when specs are fetched using non-builtins.
|
||||
mkPkgs = sources:
|
||||
let
|
||||
sourcesNixpkgs =
|
||||
import (builtins_fetchTarball { inherit (sources.nixpkgs) url sha256; }) {};
|
||||
hasNixpkgsPath = builtins.any (x: x.prefix == "nixpkgs") builtins.nixPath;
|
||||
hasThisAsNixpkgsPath = <nixpkgs> == ./.;
|
||||
in
|
||||
if builtins.hasAttr "nixpkgs" sources
|
||||
then sourcesNixpkgs
|
||||
else if hasNixpkgsPath && ! hasThisAsNixpkgsPath then
|
||||
import <nixpkgs> {}
|
||||
else
|
||||
abort
|
||||
''
|
||||
Please specify either <nixpkgs> (through -I or NIX_PATH=nixpkgs=...) or
|
||||
add a package called "nixpkgs" to your sources.json.
|
||||
'';
|
||||
|
||||
# The actual fetching function.
|
||||
fetch = pkgs: name: spec:
|
||||
|
||||
if ! builtins.hasAttr "type" spec then
|
||||
abort "ERROR: niv spec ${name} does not have a 'type' attribute"
|
||||
else if spec.type == "file" then fetch_file pkgs spec
|
||||
else if spec.type == "tarball" then fetch_tarball pkgs spec
|
||||
else if spec.type == "git" then fetch_git spec
|
||||
else if spec.type == "builtin-tarball" then fetch_builtin-tarball spec
|
||||
else if spec.type == "builtin-url" then fetch_builtin-url spec
|
||||
else
|
||||
abort "ERROR: niv spec ${name} has unknown type ${builtins.toJSON spec.type}";
|
||||
|
||||
# Ports of functions for older nix versions
|
||||
|
||||
# a Nix version of mapAttrs if the built-in doesn't exist
|
||||
mapAttrs = builtins.mapAttrs or (
|
||||
f: set: with builtins;
|
||||
listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set))
|
||||
);
|
||||
|
||||
# fetchTarball version that is compatible between all the versions of Nix
|
||||
builtins_fetchTarball = { url, sha256 }@attrs:
|
||||
let
|
||||
inherit (builtins) lessThan nixVersion fetchTarball;
|
||||
in
|
||||
if lessThan nixVersion "1.12" then
|
||||
fetchTarball { inherit url; }
|
||||
else
|
||||
fetchTarball attrs;
|
||||
|
||||
# fetchurl version that is compatible between all the versions of Nix
|
||||
builtins_fetchurl = { url, sha256 }@attrs:
|
||||
let
|
||||
inherit (builtins) lessThan nixVersion fetchurl;
|
||||
in
|
||||
if lessThan nixVersion "1.12" then
|
||||
fetchurl { inherit url; }
|
||||
else
|
||||
fetchurl attrs;
|
||||
|
||||
# Create the final "sources" from the config
|
||||
mkSources = config:
|
||||
mapAttrs (
|
||||
name: spec:
|
||||
if builtins.hasAttr "outPath" spec
|
||||
then abort
|
||||
"The values in sources.json should not have an 'outPath' attribute"
|
||||
else
|
||||
spec // { outPath = fetch config.pkgs name spec; }
|
||||
) config.sources;
|
||||
|
||||
# The "config" used by the fetchers
|
||||
mkConfig =
|
||||
{ sourcesFile ? ./sources.json
|
||||
, sources ? builtins.fromJSON (builtins.readFile sourcesFile)
|
||||
, pkgs ? mkPkgs sources
|
||||
}: rec {
|
||||
# The sources, i.e. the attribute set of spec name to spec
|
||||
inherit sources;
|
||||
|
||||
# The "pkgs" (evaluated nixpkgs) to use for e.g. non-builtin fetchers
|
||||
inherit pkgs;
|
||||
};
|
||||
in
|
||||
mkSources (mkConfig {}) // { __functor = _: settings: mkSources (mkConfig settings); }
|
238
pkgs.nix
Normal file
238
pkgs.nix
Normal file
|
@ -0,0 +1,238 @@
|
|||
{
|
||||
pkgs = hackage:
|
||||
{
|
||||
packages = {
|
||||
"void".revision = (((hackage."void")."0.7.3").revisions).default;
|
||||
"void".flags.safe = false;
|
||||
"semigroupoids".revision = (((hackage."semigroupoids")."5.3.4").revisions).default;
|
||||
"semigroupoids".flags.comonad = true;
|
||||
"semigroupoids".flags.doctests = true;
|
||||
"semigroupoids".flags.unordered-containers = true;
|
||||
"semigroupoids".flags.distributive = true;
|
||||
"semigroupoids".flags.tagged = true;
|
||||
"semigroupoids".flags.containers = true;
|
||||
"semigroupoids".flags.contravariant = true;
|
||||
"free".revision = (((hackage."free")."5.1.3").revisions).default;
|
||||
"cereal".revision = (((hackage."cereal")."0.5.8.1").revisions).default;
|
||||
"cereal".flags.bytestring-builder = false;
|
||||
"exceptions".revision = (((hackage."exceptions")."0.10.4").revisions).default;
|
||||
"exceptions".flags.transformers-0-4 = true;
|
||||
"hashtables".revision = (((hackage."hashtables")."1.2.3.4").revisions).default;
|
||||
"hashtables".flags.portable = false;
|
||||
"hashtables".flags.detailed-profiling = false;
|
||||
"hashtables".flags.sse42 = false;
|
||||
"hashtables".flags.debug = false;
|
||||
"hashtables".flags.bounds-checking = false;
|
||||
"hashtables".flags.unsafe-tricks = true;
|
||||
"binary".revision = (((hackage."binary")."0.8.6.0").revisions).default;
|
||||
"monad-parallel".revision = (((hackage."monad-parallel")."0.7.2.3").revisions).default;
|
||||
"ghc-prim".revision = (((hackage."ghc-prim")."0.5.3").revisions).default;
|
||||
"utf8-string".revision = (((hackage."utf8-string")."1.0.1.1").revisions).default;
|
||||
"bifunctors".revision = (((hackage."bifunctors")."5.5.7").revisions).default;
|
||||
"bifunctors".flags.semigroups = true;
|
||||
"bifunctors".flags.tagged = true;
|
||||
"ObjectName".revision = (((hackage."ObjectName")."1.1.0.1").revisions).default;
|
||||
"stm".revision = (((hackage."stm")."2.5.0.0").revisions).default;
|
||||
"unix".revision = (((hackage."unix")."2.7.2.2").revisions).default;
|
||||
"mtl".revision = (((hackage."mtl")."2.2.2").revisions).default;
|
||||
"linear".revision = (((hackage."linear")."1.20.9").revisions).default;
|
||||
"linear".flags.template-haskell = true;
|
||||
"linear".flags.herbie = false;
|
||||
"network-info".revision = (((hackage."network-info")."0.2.0.10").revisions).default;
|
||||
"zlib".revision = (((hackage."zlib")."0.6.2.1").revisions).default;
|
||||
"zlib".flags.non-blocking-ffi = false;
|
||||
"zlib".flags.pkg-config = false;
|
||||
"rts".revision = (((hackage."rts")."1.0").revisions).default;
|
||||
"alex".revision = (((hackage."alex")."3.2.5").revisions).default;
|
||||
"alex".flags.small_base = true;
|
||||
"clock".revision = (((hackage."clock")."0.8").revisions).default;
|
||||
"clock".flags.llvm = false;
|
||||
"adjunctions".revision = (((hackage."adjunctions")."4.4").revisions).default;
|
||||
"cryptohash-md5".revision = (((hackage."cryptohash-md5")."0.11.100.1").revisions).default;
|
||||
"invariant".revision = (((hackage."invariant")."0.5.3").revisions).default;
|
||||
"glib".revision = (((hackage."glib")."0.13.8.0").revisions).default;
|
||||
"glib".flags.closure_signals = true;
|
||||
"distributive".revision = (((hackage."distributive")."0.6.1").revisions).default;
|
||||
"distributive".flags.semigroups = true;
|
||||
"distributive".flags.tagged = true;
|
||||
"binary-orphans".revision = (((hackage."binary-orphans")."1.0.1").revisions).default;
|
||||
"OpenGLRaw".revision = (((hackage."OpenGLRaw")."3.3.4.0").revisions).default;
|
||||
"OpenGLRaw".flags.osandroid = false;
|
||||
"OpenGLRaw".flags.usenativewindowslibraries = true;
|
||||
"OpenGLRaw".flags.usegles2 = true;
|
||||
"OpenGLRaw".flags.useglxgetprocaddress = true;
|
||||
"scientific".revision = (((hackage."scientific")."0.3.6.2").revisions).default;
|
||||
"scientific".flags.integer-simple = false;
|
||||
"scientific".flags.bytestring-builder = false;
|
||||
"half".revision = (((hackage."half")."0.3").revisions).default;
|
||||
"parallel".revision = (((hackage."parallel")."3.2.2.0").revisions).default;
|
||||
"deepseq".revision = (((hackage."deepseq")."1.4.4.0").revisions).default;
|
||||
"random".revision = (((hackage."random")."1.1").revisions).default;
|
||||
"uuid-types".revision = (((hackage."uuid-types")."1.0.3").revisions).default;
|
||||
"semigroups".revision = (((hackage."semigroups")."0.19.1").revisions).default;
|
||||
"semigroups".flags.bytestring = true;
|
||||
"semigroups".flags.unordered-containers = true;
|
||||
"semigroups".flags.text = true;
|
||||
"semigroups".flags.tagged = true;
|
||||
"semigroups".flags.containers = true;
|
||||
"semigroups".flags.binary = true;
|
||||
"semigroups".flags.hashable = true;
|
||||
"semigroups".flags.transformers = true;
|
||||
"semigroups".flags.deepseq = true;
|
||||
"semigroups".flags.bytestring-builder = false;
|
||||
"semigroups".flags.template-haskell = true;
|
||||
"parsec".revision = (((hackage."parsec")."3.1.13.0").revisions).default;
|
||||
"directory".revision = (((hackage."directory")."1.3.3.0").revisions).default;
|
||||
"transformers-compat".revision = (((hackage."transformers-compat")."0.6.5").revisions).default;
|
||||
"transformers-compat".flags.five = false;
|
||||
"transformers-compat".flags.generic-deriving = true;
|
||||
"transformers-compat".flags.two = false;
|
||||
"transformers-compat".flags.five-three = true;
|
||||
"transformers-compat".flags.mtl = true;
|
||||
"transformers-compat".flags.four = false;
|
||||
"transformers-compat".flags.three = false;
|
||||
"template-haskell".revision = (((hackage."template-haskell")."2.14.0.0").revisions).default;
|
||||
"bytes".revision = (((hackage."bytes")."0.16").revisions).default;
|
||||
"bytes".flags.test-doctests = true;
|
||||
"vector".revision = (((hackage."vector")."0.12.1.1").revisions).default;
|
||||
"vector".flags.unsafechecks = false;
|
||||
"vector".flags.internalchecks = false;
|
||||
"vector".flags.wall = false;
|
||||
"vector".flags.boundschecks = true;
|
||||
"call-stack".revision = (((hackage."call-stack")."0.2.0").revisions).default;
|
||||
"primitive".revision = (((hackage."primitive")."0.7.0.0").revisions).default;
|
||||
"gtk2hs-buildtools".revision = (((hackage."gtk2hs-buildtools")."0.13.8.0").revisions).default;
|
||||
"gtk2hs-buildtools".flags.closuresignals = true;
|
||||
"profunctors".revision = (((hackage."profunctors")."5.5.1").revisions).default;
|
||||
"tagged".revision = (((hackage."tagged")."0.8.6").revisions).default;
|
||||
"tagged".flags.transformers = true;
|
||||
"tagged".flags.deepseq = true;
|
||||
"lens".revision = (((hackage."lens")."4.18.1").revisions).default;
|
||||
"lens".flags.j = false;
|
||||
"lens".flags.test-properties = true;
|
||||
"lens".flags.old-inline-pragmas = false;
|
||||
"lens".flags.test-templates = true;
|
||||
"lens".flags.trustworthy = true;
|
||||
"lens".flags.test-doctests = true;
|
||||
"lens".flags.benchmark-uniplate = false;
|
||||
"lens".flags.inlining = true;
|
||||
"lens".flags.dump-splices = false;
|
||||
"lens".flags.test-hunit = true;
|
||||
"lens".flags.safe = false;
|
||||
"containers".revision = (((hackage."containers")."0.6.0.1").revisions).default;
|
||||
"integer-logarithms".revision = (((hackage."integer-logarithms")."1.0.3").revisions).default;
|
||||
"integer-logarithms".flags.check-bounds = false;
|
||||
"integer-logarithms".flags.integer-gmp = true;
|
||||
"reflection".revision = (((hackage."reflection")."2.1.5").revisions).default;
|
||||
"reflection".flags.slow = false;
|
||||
"reflection".flags.template-haskell = true;
|
||||
"OpenGL".revision = (((hackage."OpenGL")."3.0.3.0").revisions).default;
|
||||
"bytestring".revision = (((hackage."bytestring")."0.10.8.2").revisions).default;
|
||||
"JuicyPixels".revision = (((hackage."JuicyPixels")."3.3.4").revisions).default;
|
||||
"JuicyPixels".flags.mmap = false;
|
||||
"cryptohash-sha1".revision = (((hackage."cryptohash-sha1")."0.11.100.1").revisions).default;
|
||||
"StateVar".revision = (((hackage."StateVar")."1.2").revisions).default;
|
||||
"contravariant".revision = (((hackage."contravariant")."1.5.2").revisions).default;
|
||||
"contravariant".flags.semigroups = true;
|
||||
"contravariant".flags.tagged = true;
|
||||
"contravariant".flags.statevar = true;
|
||||
"GLURaw".revision = (((hackage."GLURaw")."2.0.0.4").revisions).default;
|
||||
"GLURaw".flags.usenativewindowslibraries = true;
|
||||
"type-equality".revision = (((hackage."type-equality")."1").revisions).default;
|
||||
"uuid".revision = (((hackage."uuid")."1.3.13").revisions).default;
|
||||
"text".revision = (((hackage."text")."1.2.3.1").revisions).default;
|
||||
"Cabal".revision = (((hackage."Cabal")."2.4.0.1").revisions).default;
|
||||
"unordered-containers".revision = (((hackage."unordered-containers")."0.2.10.0").revisions).default;
|
||||
"unordered-containers".flags.debug = false;
|
||||
"base".revision = (((hackage."base")."4.12.0.0").revisions).default;
|
||||
"comonad".revision = (((hackage."comonad")."5.0.6").revisions).default;
|
||||
"comonad".flags.distributive = true;
|
||||
"comonad".flags.test-doctests = true;
|
||||
"comonad".flags.containers = true;
|
||||
"time".revision = (((hackage."time")."1.8.0.2").revisions).default;
|
||||
"transformers".revision = (((hackage."transformers")."0.5.6.2").revisions).default;
|
||||
"hashable".revision = (((hackage."hashable")."1.3.0.0").revisions).default;
|
||||
"hashable".flags.sse2 = true;
|
||||
"hashable".flags.integer-gmp = true;
|
||||
"hashable".flags.sse41 = false;
|
||||
"hashable".flags.examples = false;
|
||||
"JuicyPixels-extra".revision = (((hackage."JuicyPixels-extra")."0.4.1").revisions).default;
|
||||
"JuicyPixels-extra".flags.dev = false;
|
||||
"transformers-base".revision = (((hackage."transformers-base")."0.4.5.2").revisions).default;
|
||||
"transformers-base".flags.orphaninstances = true;
|
||||
"happy".revision = (((hackage."happy")."1.19.12").revisions).default;
|
||||
"happy".flags.small_base = true;
|
||||
"entropy".revision = (((hackage."entropy")."0.4.1.5").revisions).default;
|
||||
"entropy".flags.halvm = false;
|
||||
"filepath".revision = (((hackage."filepath")."1.4.2.1").revisions).default;
|
||||
"monad-loops".revision = (((hackage."monad-loops")."0.4.3").revisions).default;
|
||||
"monad-loops".flags.base4 = true;
|
||||
"process".revision = (((hackage."process")."1.6.5.0").revisions).default;
|
||||
"kan-extensions".revision = (((hackage."kan-extensions")."5.2").revisions).default;
|
||||
"fixed".revision = (((hackage."fixed")."0.3").revisions).default;
|
||||
"pretty".revision = (((hackage."pretty")."1.1.3.6").revisions).default;
|
||||
"cabal-doctest".revision = (((hackage."cabal-doctest")."1.0.8").revisions).default;
|
||||
"ghc-boot-th".revision = (((hackage."ghc-boot-th")."8.6.5").revisions).default;
|
||||
"base-orphans".revision = (((hackage."base-orphans")."0.8.2").revisions).default;
|
||||
"sdl2".revision = (((hackage."sdl2")."2.5.0.0").revisions).default;
|
||||
"sdl2".flags.no-linear = false;
|
||||
"sdl2".flags.opengl-example = false;
|
||||
"sdl2".flags.examples = false;
|
||||
"th-abstraction".revision = (((hackage."th-abstraction")."0.3.1.0").revisions).default;
|
||||
"array".revision = (((hackage."array")."0.5.3.0").revisions).default;
|
||||
"integer-gmp".revision = (((hackage."integer-gmp")."1.0.2.0").revisions).default;
|
||||
};
|
||||
compiler = {
|
||||
version = "8.6.5";
|
||||
nix-name = "ghc865";
|
||||
packages = {
|
||||
"binary" = "0.8.6.0";
|
||||
"ghc-prim" = "0.5.3";
|
||||
"unix" = "2.7.2.2";
|
||||
"mtl" = "2.2.2";
|
||||
"rts" = "1.0";
|
||||
"deepseq" = "1.4.4.0";
|
||||
"parsec" = "3.1.13.0";
|
||||
"directory" = "1.3.3.0";
|
||||
"template-haskell" = "2.14.0.0";
|
||||
"containers" = "0.6.0.1";
|
||||
"bytestring" = "0.10.8.2";
|
||||
"text" = "1.2.3.1";
|
||||
"Cabal" = "2.4.0.1";
|
||||
"base" = "4.12.0.0";
|
||||
"time" = "1.8.0.2";
|
||||
"transformers" = "0.5.6.2";
|
||||
"filepath" = "1.4.2.1";
|
||||
"process" = "1.6.5.0";
|
||||
"pretty" = "1.1.3.6";
|
||||
"ghc-boot-th" = "8.6.5";
|
||||
"array" = "0.5.3.0";
|
||||
"integer-gmp" = "1.0.2.0";
|
||||
};
|
||||
};
|
||||
};
|
||||
extras = hackage:
|
||||
{
|
||||
packages = {
|
||||
affection = ./.plan.nix/affection.nix;
|
||||
canvas = ./.plan.nix/canvas.nix;
|
||||
};
|
||||
};
|
||||
modules = [
|
||||
({ lib, ... }:
|
||||
{
|
||||
packages = {
|
||||
"affection" = {
|
||||
flags = {
|
||||
"verbose" = lib.mkOverride 900 false;
|
||||
"error" = lib.mkOverride 900 false;
|
||||
"debug" = lib.mkOverride 900 false;
|
||||
"warn" = lib.mkOverride 900 false;
|
||||
"examples" = lib.mkOverride 900 false;
|
||||
};
|
||||
};
|
||||
"canvas" = { flags = {}; };
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
|
@ -1,4 +1,6 @@
|
|||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
let
|
||||
hsPkgs = import ./default.nix {};
|
||||
hsPkgs = import ./default.nix;
|
||||
in
|
||||
hsPkgs.canvas.components.all
|
||||
|
|
Loading…
Reference in a new issue