Skip to content

Commit c10c6e6

Browse files
committed
work-in-progress Nix support
with https://github.com/input-output-hk/haskell.nix
1 parent 26bdd60 commit c10c6e6

File tree

15 files changed

+284
-27
lines changed

15 files changed

+284
-27
lines changed

.github/workflows/ci.yml renamed to .github/workflows/Cabal.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# modified from https://github.com/jgm/pandoc/blob/master/.github/workflows/ci.yml
2-
name: CI
2+
name: Cabal
33

44
on:
55
push:

.github/workflows/Nix.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Nix
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
paths-ignore: []
8+
pull_request:
9+
paths-ignore: []
10+
11+
jobs:
12+
linux:
13+
14+
runs-on: ubuntu-20.04
15+
strategy:
16+
fail-fast: false
17+
steps:
18+
- uses: actions/checkout@v2
19+
20+
# https://github.com/marketplace/actions/install-nix
21+
- name: Install Nix
22+
uses: cachix/install-nix-action@v14
23+
with:
24+
extra_nix_config: |
25+
trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= haskell-language-server.cachix.org-1:juFfHrwkOxqIOZShtC4YC1uT1bBcq2RSvC7OMKx0Nz8=
26+
substituters = https://hydra.iohk.io https://cache.nixos.org/ https://haskell-language-server.cachix.org
27+
- run: nix build

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ CodeWorld
22
=========
33

44
[![Build Status](https://travis-ci.org/google/codeworld.svg?branch=master)](https://travis-ci.org/google/codeworld)
5-
[![Build status](https://github.com/google/codeworld/actions/workflows/ci.yml/badge.svg)](https://github.com/google/codeworld/actions/workflows/ci.yml)
5+
[![Build status](https://github.com/google/codeworld/actions/workflows/Cabal.yml/badge.svg)](https://github.com/google/codeworld/actions/workflows/Cabal.yml)
6+
[![Build status](https://github.com/google/codeworld/actions/workflows/Nix.yml/badge.svg)](https://github.com/google/codeworld/actions/workflows/Nix.yml)
67

78
CodeWorld is an educational environment using Haskell. It provides a simple
89
mathematical model for geometric figures, animations, and interactive and

cabal.project

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
packages:
2-
codeworld-account/
2+
-- codeworld-account/
33
codeworld-api/
4-
codeworld-auth/
5-
codeworld-compiler/
6-
codeworld-error-sanitizer/
4+
-- codeworld-auth/
5+
-- codeworld-available-pkgs/
6+
-- codeworld-compiler/
7+
-- codeworld-error-sanitizer/
78
codeworld-game-api/
8-
codeworld-game-server/
9+
-- codeworld-game-server/
910
codeworld-prediction/
10-
codeworld-server/
11-
codeworld-base/
12-
funblocks-client/
11+
-- codeworld-server/
12+
-- codeworld-base/
13+
-- funblocks-client/

codeworld-api/codeworld-api.cabal

+4-4
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Library
6161
mtl >= 2.2.1 && < 2.3,
6262
random >= 1.1 && < 1.2,
6363
ref-tf >= 0.4 && < 0.5,
64-
reflex >= 0.6.3 && < 0.7,
64+
reflex >= 0.6.3,
6565
template-haskell >= 2.8 && < 2.18,
6666
text >= 1.2.2 && < 1.3,
6767
time >= 1.8 && < 2.0,
@@ -73,7 +73,7 @@ Library
7373
ghcjs-prim,
7474
codeworld-game-api,
7575
codeworld-prediction,
76-
ghcjs-dom >= 0.9 && < 0.9.4,
76+
ghcjs-dom >= 0.9,
7777
transformers
7878
else
7979
Build-depends: blank-canvas >= 0.6 && < 0.8,
@@ -122,7 +122,7 @@ Test-suite unit-tests
122122
mtl >= 2.2.1 && < 2.3,
123123
random >= 1.1 && < 1.2,
124124
ref-tf >= 0.4 && < 0.5,
125-
reflex >= 0.6.3 && < 0.7,
125+
reflex >= 0.6.3,
126126
template-haskell >= 2.8 && < 2.18,
127127
text >= 1.2.2 && < 1.3,
128128
time >= 1.8 && < 2.0,
@@ -134,7 +134,7 @@ Test-suite unit-tests
134134
ghcjs-prim,
135135
codeworld-game-api,
136136
codeworld-prediction,
137-
ghcjs-dom >= 0.9 && < 0.9.4,
137+
ghcjs-dom >= 0.9,
138138
transformers
139139
else
140140
Build-depends: blank-canvas >= 0.6 && < 0.8,

codeworld-available-pkgs/codeworld-available-pkgs.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Library
138138
generics-sop,
139139
ghc-prim,
140140
ghcjs-base,
141-
ghcjs-dom,
141+
ghcjs-dom >=0.9,
142142
ghcjs-perch,
143143
ghcjs-prim,
144144
gray-code,

codeworld-base/codeworld-base.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Library
4545
codeworld-api,
4646
ghc-prim,
4747
ghcjs-base,
48-
ghcjs-dom,
48+
ghcjs-dom >=0.9,
4949
mtl,
5050
random,
5151
random-shuffle,

codeworld-compiler/codeworld-compiler.cabal

+5-3
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,18 @@ Library
5454
directory,
5555
exceptions,
5656
filepath,
57-
ghc == 8.6.5,
58-
ghc-boot-th == 8.6.5,
57+
ghc,
58+
ghc-boot,
59+
ghc-boot-th,
60+
ghc-lib-parser,
5961
hashable,
6062
haskell-src-exts >= 1.20,
6163
megaparsec >= 7.0.0 && < 8.0.0,
6264
memory,
6365
mtl,
6466
process,
67+
regex-base,
6568
regex-tdfa,
66-
regex-tdfa-text,
6769
split,
6870
syb,
6971
temporary,

codeworld-error-sanitizer/codeworld-error-sanitizer.cabal

+2-4
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ Library
2525
else
2626
Build-depends: array,
2727
regex-base,
28-
regex-tdfa,
29-
regex-tdfa-text
28+
regex-tdfa
3029

3130
Default-language: Haskell2010
3231
Exposed: True
@@ -49,7 +48,6 @@ Test-suite unit-tests
4948
else
5049
Build-depends: array,
5150
regex-base,
52-
regex-tdfa,
53-
regex-tdfa-text
51+
regex-tdfa
5452

5553
Default-language: Haskell2010

codeworld-requirements/codeworld-requirements.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ library
3636
haskell-src-exts >= 1.20,
3737
mtl,
3838
process,
39+
regex-base,
3940
regex-tdfa,
40-
regex-tdfa-text,
4141
syb,
4242
temporary,
4343
text,

codeworld-server/codeworld-server.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Executable codeworld-server
3939
fast-logger,
4040
filelock,
4141
filepath,
42-
haskell-src-exts < 1.21,
42+
haskell-src-exts,
4343
http-conduit,
4444
lifted-base,
4545
memory,

default.nix

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# https://input-output-hk.github.io/haskell.nix/tutorials/getting-started/
2+
let
3+
sources = import ./nix/sources.nix {};
4+
haskellNix = import sources.haskellNix {};
5+
pkgs = import
6+
haskellNix.sources.nixpkgs-2105
7+
haskellNix.nixpkgsArgs;
8+
# in pkgs.pkgsCross.ghcjs.haskell-nix.project {
9+
in pkgs.haskell-nix.project {
10+
projectFileName = "cabal.project";
11+
src = pkgs.haskell-nix.haskellLib.cleanGit {
12+
name = "haskell-nix-project";
13+
src = ./.;
14+
};
15+
compiler-nix-name = "ghc8107";
16+
}

funblocks-client/funblocks-client.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ Executable funblocks-client
3838
Build-depends: ghcjs-base,
3939
text,
4040
containers,
41-
ghcjs-dom,
41+
ghcjs-dom >=0.9,
4242
mtl
4343
else
4444
Build-depends: ghcjs-base-stub,
4545
text,
4646
containers,
47-
ghcjs-dom,
47+
ghcjs-dom >=0.9,
4848
mtl

nix/sources.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"haskellNix": {
3+
"branch": "master",
4+
"description": "Alternative Haskell Infrastructure for Nixpkgs",
5+
"homepage": "https://input-output-hk.github.io/haskell.nix",
6+
"owner": "input-output-hk",
7+
"repo": "haskell.nix",
8+
"rev": "f51f24f8d24c1fd3f3a9bc7e93d008ede09baaab",
9+
"sha256": "16shqxlvfa4hpshrn0wbjlwrvmiqg6l6p4fjpsbr882m26jgk2qx",
10+
"type": "tarball",
11+
"url": "https://github.com/input-output-hk/haskell.nix/archive/f51f24f8d24c1fd3f3a9bc7e93d008ede09baaab.tar.gz",
12+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
13+
},
14+
"niv": {
15+
"branch": "master",
16+
"description": "Easy dependency management for Nix projects",
17+
"homepage": "https://github.com/nmattia/niv",
18+
"owner": "nmattia",
19+
"repo": "niv",
20+
"rev": "65a61b147f307d24bfd0a5cd56ce7d7b7cc61d2e",
21+
"sha256": "17mirpsx5wyw262fpsd6n6m47jcgw8k2bwcp1iwdnrlzy4dhcgqh",
22+
"type": "tarball",
23+
"url": "https://github.com/nmattia/niv/archive/65a61b147f307d24bfd0a5cd56ce7d7b7cc61d2e.tar.gz",
24+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
25+
},
26+
"nixpkgs": {
27+
"branch": "release-20.03",
28+
"description": "Nix Packages collection",
29+
"homepage": "",
30+
"owner": "NixOS",
31+
"repo": "nixpkgs",
32+
"rev": "eb73405ecceb1dc505b7cbbd234f8f94165e2696",
33+
"sha256": "06k21wbyhhvq2f1xczszh3c2934p0m02by3l2ixvd6nkwrqklax7",
34+
"type": "tarball",
35+
"url": "https://github.com/NixOS/nixpkgs/archive/eb73405ecceb1dc505b7cbbd234f8f94165e2696.tar.gz",
36+
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
37+
}
38+
}

0 commit comments

Comments
 (0)