-
Notifications
You must be signed in to change notification settings - Fork 13
/
flake.nix
87 lines (76 loc) · 3.61 KB
/
flake.nix
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
82
83
84
85
86
87
{
description = "Idris2 and its packages";
inputs = {
idris2 = { url = "github:idris-lang/idris2"; flake = false; };
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-21.11-darwin";
comonad = { url = "github:stefan-hoeck/idris2-comonad"; flake = false; };
collie = { url = "github:ohad/collie"; flake = false; };
python = { url = "github:madman-bob/idris2-python"; flake = false; };
odf = { url = "github:madman-bob/idris2-odf"; flake = false; };
katla = { url = "github:idris-community/katla"; flake = false; };
dot-parse = { url = "github:CodingCellist/idris2-dot-parse"; flake = false; };
dom = { url = "github:stefan-hoeck/idris2-dom"; flake = false; };
elab-util = { url = "github:stefan-hoeck/idris2-elab-util"; flake = false; };
effect = { url = "github:russoul/idris2-effect"; flake = false; };
hedgehog = { url = "github:stefan-hoeck/idris2-hedgehog"; flake = false; };
fvect = { url = "github:mattpolzin/idris-fvect"; flake = false; };
idrall = { url = "github:alexhumphreys/idrall/13ef174"; flake = false; };
ipkg-to-json = { url = "github:claymager/ipkg-to-json"; flake = false; };
inigo = { url = "github:idris-community/Inigo"; flake = false; };
lsp = { url = "github:idris-community/idris2-lsp"; flake = false; };
frex = { url = "github:frex-project/idris-frex"; flake = false; };
json = { url = "github:stefan-hoeck/idris2-json"; flake = false; };
Prettier = { url = "github:Z-snails/prettier"; flake = false; };
pretty-show = { url = "github:stefan-hoeck/idris2-pretty-show"; flake = false; };
sop = { url = "github:stefan-hoeck/idris2-sop"; flake = false; };
rhone = { url = "github:stefan-hoeck/idris2-rhone"; flake = false; };
rhone-js = { url = "github:stefan-hoeck/idris2-rhone-js"; flake = false; };
tailrec = { url = "github:stefan-hoeck/idris2-tailrec"; flake = false; };
idris-server = { url = "gitlab:avidela/idris-server"; flake = false; };
xml = { url = "github:madman-bob/idris2-xml"; flake = false; };
indexed = { url = "github:mattpolzin/idris-indexed"; flake = false; };
hashable = { url = "github:z-snails/idris2-hashable"; flake = false; };
snocvect = { url = "github:mattpolzin/idris-snocvect"; flake = false; };
};
outputs = { self, nixpkgs, idris2, flake-utils, ... }@srcs:
let
inherit (builtins) removeAttrs mapAttrs;
inherit (nixpkgs.lib) recursiveUpdate makeOverridable;
templates = import ./templates;
lib = import ./lib;
in
{
overlay = final: prev:
let
compiler = (final.callPackage ./compiler.nix { idris2-src = idris2; }).c;
idris2-pkgs = makeOverridable (import ./packageSet.nix) {
sources = removeAttrs srcs [ "self" "nixpkgs" "flake-utils" ];
lib = recursiveUpdate nixpkgs.lib lib;
pkgs = final;
idris2 = compiler;
};
in
{
inherit idris2-pkgs;
idris2 = idris2-pkgs.idris2;
lib = recursiveUpdate prev.lib (import ./lib);
};
inherit templates lib;
defaultTemplate = templates.simple;
} //
flake-utils.lib.eachSystem [ "x86_64-linux" "x86_64-darwin" "i686-linux" ]
(system:
let
pkgs = import nixpkgs { inherit system; overlays = [ self.overlay ]; };
ipkgs = removeAttrs pkgs.idris2-pkgs [ "override" "overrideDerivation" ];
in
{
packages = ipkgs;
defaultPackage = ipkgs.idris2;
devShell = pkgs.mkShell {
buildInputs = [ pkgs.nixpkgs-fmt ];
};
}
);
}