-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
62 lines (51 loc) · 2.05 KB
/
flake.nix
File metadata and controls
62 lines (51 loc) · 2.05 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
{
description = "minimal-hslua-wasm-example";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
ghc-wasm-meta.url = "gitlab:haskell-wasm/ghc-wasm-meta?host=gitlab.haskell.org";
};
outputs = { self, nixpkgs, flake-utils, ghc-wasm-meta }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
haskellPackages = pkgs.haskellPackages;
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
# DON'T FORGET TO PUT YOUR PACKAGE NAME HERE, REMOVING `throw`
packageName = "minimal-example";
wasmToolchain = ghc-wasm-meta.packages.${system}.default;
# Alternatively, if you want a specific "bundle" exposed by ghc-wasm-meta:
# wasmToolchain = ghc-wasm-meta.packages.${system}.all_9_14;
in {
packages.${packageName} = haskellPackages.callCabal2nix packageName self { };
packages.default = self.packages.${system}.${packageName};
defaultPackage = self.packages.${system}.default;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
wasmToolchain
haskellPackages.haskell-language-server # you must build it with your ghc to work
haskellPackages.hlint
haskellPackages.cabal-install
haskellPackages.cabal-plan
haskellPackages.weeder
haskellPackages.hpc
haskellPackages.ghcid
haskellPackages.stylish-haskell
haskellPackages.eventlog2html
haskellPackages.profiterole
haskellPackages.profiteur
zlib.dev
git
bashInteractive
epubcheck # for validate-epub
nodejs # for validate-epub
ripgrep
libxml2 # for xmllint
jq
];
inputsFrom = map (__getAttr "env") (__attrValues self.packages.${system});
};
devShell = self.devShells.${system}.default;
});
}