-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathflake.nix
85 lines (79 loc) · 2.6 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
{
description = "Hoodle: pen notetaking program";
inputs = {
# for ghc944, libdeflate needs to be packaged with pkg-config
# also, haskellPackages are updated for gtk.
# TODO: back to NixOS/nixpkgs/master when handled.
nixpkgs.url = "github:wavewave/nixpkgs/libdeflate-fix-on-peti-master";
# build failure due to failing linear_base from nixos 22.05 on.
nixpkgs_21_11.url = "github:NixOS/nixpkgs/nixos-21.11";
flake-utils.url = "github:numtide/flake-utils";
hackage-index = {
type = "file";
flake = false;
url = "https://api.github.com/repos/commercialhaskell/all-cabal-hashes/tarball/dc285e8b0968426833746d3f776657c436fb65e0";
};
TypeCompose = {
url = "github:conal/TypeCompose/master";
flake = false;
};
ghc_nix = {
url = "github:wavewave/ghc.nix/fix-hash-again";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nixpkgs-unstable.follows = "nixpkgs";
inputs.all-cabal-hashes.follows = "hackage-index";
};
ghc-eventlog-socket = {
url = "github:wavewave/ghc-eventlog-socket/darwin-flake";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = inputs @ {
self,
nixpkgs,
nixpkgs_21_11,
flake-utils,
...
}:
flake-utils.lib.eachSystem flake-utils.lib.allSystems (system: let
pkgs = import nixpkgs {inherit system;};
pkgs_21_11 = import nixpkgs_21_11 {inherit system;};
haskellLib = pkgs.haskell.lib;
# gtk
gtk = import ./nix/gtk.nix {
inherit (inputs) ghc-eventlog-socket TypeCompose;
inherit pkgs haskellLib;
};
# web
web = import ./nix/web.nix {
pkgs = pkgs_21_11;
inherit haskellLib;
};
# ghc.nix
ghc_nix = import ./nix/ghc_nix.nix {
inherit (inputs) ghc_nix;
inherit system pkgs;
};
in rec {
# This package set is only useful for CI build test.
packages.gtk =
pkgs.lib.genAttrs gtk.supportedCompilers (compiler: gtk.mkPkgsFor compiler);
defaultPackage = packages.gtk.${gtk.defaultCompiler}.hoodle;
inherit (gtk) haskellOverlay;
devShells = let
gtkShells =
pkgs.lib.genAttrs gtk.supportedCompilers
(compiler: gtk.mkShellFor compiler);
webShells =
pkgs.lib.genAttrs web.supportedCompilersWeb
(compiler: web.mkWebShellFor compiler);
ghcNixShell = ghc_nix.ghcNixShell;
in rec {
default = gtk.${gtk.defaultCompiler};
gtk = gtkShells;
web = webShells;
ghc_nix = ghcNixShell;
};
});
}