-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathflake.nix
More file actions
77 lines (72 loc) · 2.48 KB
/
flake.nix
File metadata and controls
77 lines (72 loc) · 2.48 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
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
haskell-flake.url = "github:srid/haskell-flake";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = inputs@{ self, nixpkgs, flake-compat, flake-parts, haskell-flake, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" "aarch64-linux" ];
imports = [ inputs.haskell-flake.flakeModule ];
perSystem = { self', system, pkgs, ... }: {
haskellProjects.default = {
basePackages = pkgs.haskell.packages.ghc96;
# To get access to non-Haskell dependencies one most add them to `extraBuildDepends`
# and then use the haskell package `which` to locate the Filepath of the executable
# that's being added. In this toy example we'll be using the non-Haskell dependency
# `cowsay` findable in nixpkgs like so:
#
# telomare = {
# extraBuildDepends = [ pkgs.cowsay
# ];
# };
#
# An example of Haskell code using `cowsay` would be:
# ```haskell
# cowsayBin :: FilePath
# cowsayBin = $(staticWhich "cowsay")
# cowsay :: IO String
# cowsay = do
# (_, mhout, _, _) <- createProcess (shell $ show cowsayBin <> " hola") { std_out = CreatePipe }
# case mhout of
# Just hout -> hGetContents hout
# Nothing -> pure "mhout failed"
# ```
# settings = {
# semaphore-compat = {
# check = false;
# jailbreak = true;
# };
# };
devShell = {
enable = true;
tools = hp: {
inherit (hp) cabal-install haskell-language-server;
};
};
};
packages.default = self'.packages.telomare;
apps.default = {
type = "app";
program = self.packages.${system}.telomare + "/bin/telomare";
};
apps.repl = {
type = "app";
program = self.packages.${system}.telomare + "/bin/telomare-repl";
};
apps.evaluare = {
type = "app";
program = self.packages.${system}.telomare + "/bin/telomare-evaluare";
};
apps.lsp = {
type = "app";
program = "${self.packages.${system}.telomare}/bin/telomare-lsp";
};
checks = self'.packages;
};
};
}