Skip to content

Commit 3ded84e

Browse files
authored
Bump nix and dhall (#102)
1 parent 182ad0f commit 3ded84e

37 files changed

Lines changed: 131 additions & 92 deletions

File tree

.github/workflows/nix-test.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,24 @@ on:
33
pull_request:
44
push:
55
branches:
6-
- 'main'
6+
- "main"
77
jobs:
88
test-matrix:
99
strategy:
1010
matrix:
1111
os: [ubuntu-latest, macos-latest]
1212
runs-on: ${{ matrix.os }}
1313
steps:
14-
- name: Checkout
15-
uses: actions/checkout@v3
16-
- name: Set up nix
17-
uses: cachix/install-nix-action@v18
18-
- name: Start cachix
19-
uses: cachix/cachix-action@v12
20-
with:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
- name: Set up nix
17+
uses: cachix/install-nix-action@v31
18+
- name: Start cachix
19+
uses: cachix/cachix-action@v15
20+
with:
2121
name: replica
22-
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
23-
- name: Test build
24-
run: nix build
25-
- name: Run tests
26-
run: nix flake check --show-trace
22+
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
23+
- name: Test build
24+
run: nix build
25+
- name: Run tests
26+
run: nix flake check --show-trace

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ examples/.replica
1818
src/Replica/Version.idr
1919

2020
/build
21-
/submodules
22-
21+
/depends
22+
/result

.replica/test/fileREPL/expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
1/1: Building Test (Test.idr)
2-
Test> "Hello, World!"
2+
Test> "Hello, World!"
33
Test> Bye for now!

.replica/test/packageREPL/expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
1/1: Building Test (Test.idr)
22
Test> Imported module Test
3-
Test> "Hello, World!"
3+
Test> "Hello, World!"
44
Test> Bye for now!

.replica/test/rawREPL/expected

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Main> Just "work!"
1+
Main> Just "work!"
22
Main> Bye for now!

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ REPLICA_TESTS_DHALL := $(wildcard ./tests/replica/*/*.dhall)
99
REPLICA_TESTS := $(REPLICA_TESTS_DHALL:.dhall=.json)
1010
REPLICA_EXE := build/exec/replica
1111

12-
META_DHALL := $(wildcard ./tests/META/*.dhall)
12+
META_DHALL := $(wildcard ./tests/Meta/*.dhall)
1313
TEST_INCLUDE_DHALL := $(wildcard ./tests/*.dhall)
1414

1515
DEST = ${HOME}/.local/bin
1616

1717
build: src/Replica/Version.idr
1818
idris2 --build replica.ipkg
1919

20+
# Generate the version module in Idris from version.nix
2021
src/Replica/Version.idr: version.nix
2122
echo "module Replica.Version" > src/Replica/Version.idr
2223
echo "" >> src/Replica/Version.idr
@@ -35,13 +36,14 @@ clean-test:
3536
clean: clean-test
3637
${RM} -r build
3738

39+
# Generate JSON from Dhall
3840
.dhall.json:
3941
dhall-to-json --file $? --output $@
4042

4143
${TEST}: ${TEST_DHALL} ${TEST_INCLUDE_DHALL}
4244
dhall-to-json --file ${TEST_DHALL} --output $@
4345

44-
freeze: ${TEST_DHALL} ${META_DHALL} ${TEST_INCLUDE_DHALL}
46+
freeze: ${TEST_DHALL} ${META_DHALL} ${TEST_INCLUDE_DHALL} ${REPLICA_TESTS_DHALL}
4547
dhall freeze $?
4648

4749
generate: ${REPLICA_TESTS} ${TEST} build

flake.lock

Lines changed: 71 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
outputs = { self, nixpkgs, idris, papers, flake-utils, pre-commit-hooks, replicadhall }:
1919
flake-utils.lib.eachDefaultSystem (system:
2020
let
21-
pkgs = import nixpkgs { inherit system; };
22-
inherit (pkgs)
21+
npkgs = import nixpkgs { inherit system; };
22+
inherit (npkgs)
2323
dhall
2424
lib;
25-
inherit (pkgs.haskellPackages)
25+
inherit (npkgs.haskellPackages)
2626
dhall-json;
2727

2828
version = import ./version.nix;
29-
idrisPkgs = idris.packages.${system};
29+
idrisPkgs = idris.packages.${system} // papers;
3030

31-
callPackage = lib.callPackageWith (pkgs // packages);
31+
callPackage = lib.callPackageWith (npkgs // packages);
3232

3333
packages = {
3434
inherit version;
@@ -46,7 +46,7 @@
4646
replica_dhall
4747
papersLib;
4848

49-
dockerImage = pkgs.dockerTools.buildImage {
49+
dockerImage = npkgs.dockerTools.buildImage {
5050
name = "replica";
5151
config = {
5252
Cmd = [ "${replica}/bin/replica" ];
@@ -75,8 +75,8 @@
7575
};
7676
};
7777

78-
devShells.default = pkgs.mkShell {
79-
packages = [ idrisPkgs.idris2 papersLib pkgs.rlwrap dhall dhall-json ];
78+
devShells.default = npkgs.mkShell {
79+
packages = [ idrisPkgs.idris2 papersLib npkgs.rlwrap dhall dhall-json ];
8080
shellHook = ''
8181
alias idris2="rlwrap -s 1000 idris2 --no-banner"
8282
${self.checks.${system}.pre-commit-check.shellHook}

nix/buildReplica.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{ buildIdris, papersLib }:
22
buildIdris {
3-
projectName = "replica";
3+
ipkgName = "replica";
44
src = ../.;
55
idrisLibraries = [ papersLib ];
66
}

nix/papersLib.nix

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
let
33
version = import ../version.nix;
44
papersPkg = buildIdris {
5-
projectName = "papers";
5+
ipkgName = "papers";
66
src = papers;
77
idrisLibraries = [ ];
8-
preBuild = "cd libs/papers";
98
};
109
in
11-
papersPkg.installLibrary
10+
papersPkg.library { }

0 commit comments

Comments
 (0)