-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathflake.nix
More file actions
81 lines (71 loc) · 2.25 KB
/
flake.nix
File metadata and controls
81 lines (71 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{
description = "Golden tests for command-line interfaces.";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
idris = {
url = "github:idris-lang/Idris2";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
replicadhall.url = "github:ReplicaTest/replica-dhall";
};
outputs = { self, nixpkgs, idris, flake-utils, pre-commit-hooks, replicadhall }:
flake-utils.lib.eachDefaultSystem (system:
let
npkgs = import nixpkgs { inherit system; };
inherit (npkgs)
dhall
idris2
lib;
inherit (npkgs.haskellPackages)
dhall-json;
version = import ./version.nix;
callPackage = lib.callPackageWith (npkgs // packages);
packages = {
inherit version;
buildIdris = idris.buildIdris.${system};
replica_dhall = replicadhall.packages.${system}.default;
buildReplica = callPackage ./nix/buildReplica.nix { };
replica = callPackage ./nix/replica.nix { };
replicaTest = callPackage ./nix/replica.nix { };
};
inherit (packages)
replica
replicaTest;
dockerImage = npkgs.dockerTools.buildImage {
name = "replica";
config = {
Cmd = [ "${replica}/bin/replica" ];
};
tag = "v${version}";
};
in
{
packages = {
default = replica;
replica = replica;
docker = dockerImage;
};
checks = {
tests = replicaTest;
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixpkgs-fmt.enable = true;
dhall-format.enable = true;
markdownlint.enable = true;
online-tests = import ./nix/online-tests.nix;
};
};
};
devShells.default = npkgs.mkShell {
packages = [ idris2 npkgs.rlwrap dhall dhall-json ];
shellHook = ''
alias idris2="rlwrap -s 1000 idris2 --no-banner"
${self.checks.${system}.pre-commit-check.shellHook}
'';
};
}
);
}