-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
71 lines (66 loc) · 1.82 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
{
description = "Harmony GitHub collaboration tool";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
packageset.url = "github:mattpolzin/nix-idris2-packages";
};
# we use Idris2 from nixpkgs unstable because it will already be built and cached.
# harmony should always build against the latest Idris2 release so this is a nice
# default for the flake.
outputs =
{
self,
nixpkgs,
packageset,
}:
let
lib = nixpkgs.lib;
forAllSystems = lib.genAttrs lib.systems.flakeExposed;
in
{
packages = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
idris2Packages = packageset.idris2Packages.${system};
buildIdris = packageset.packages.${system}.buildIdris';
in
{
harmony = pkgs.callPackage ./default.nix { inherit buildIdris; };
default = self.packages.${system}.harmony;
}
);
checks = forAllSystems (
system:
let
harmony = self.packages.${system}.harmony;
in
{
tests = harmony.overrideAttrs { doInstallCheck = true; };
}
);
devShells = forAllSystems (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
inherit (packageset.packages.${system}) idris2 idris2Lsp;
in
{
default = pkgs.mkShell {
inputsFrom = [ self.packages.${system}.harmony ];
packages = [
idris2
idris2Lsp
];
};
}
);
formatter = forAllSystems (system: nixpkgs.legacyPackages.${system}.nixfmt-rfc-style);
};
nixConfig = {
extra-substituters = [
"https://gh-nix-idris2-packages.cachix.org"
"https://gh-harmony.cachix.org"
];
};
}