-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
flake.nix
66 lines (59 loc) · 1.92 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
{
description = "Fission tools";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/release-22.05";
flake-utils.url = "github:numtide/flake-utils";
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages.${system};
# Inspired by https://www.tweag.io/blog/2022-06-02-haskell-stack-nix-shell/
stack-wrapped = pkgs.symlinkJoin {
name = "stack";
paths = [ pkgs.stack ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/stack \
--add-flags "\
--nix \
--nix-shell-file=nix/stack-integration.nix \
"
'';
};
# Wrapper commands for convenience
commands = import ./nix/commands.nix;
server-path = "~/.local/bin/fission-server";
tasks = commands {
inherit pkgs;
inherit server-path;
inherit stack-wrapped;
};
# The default version of HLS (with binary cache) is built with GHC 9.0.1
# We can get this version working with our current set up, but it builds
# from source (and takes a long time).
#
# The prebuilt package is marked as broken on aarch64-darwin
haskellPackages = pkgs.haskell.packages.ghc8107;
in
{
devShells.default = pkgs.mkShell {
name = "fission";
buildInputs = [
stack-wrapped
haskellPackages.haskell-language-server
pkgs.cachix
pkgs.nixpkgs-fmt
pkgs.stylish-haskell
tasks
];
NIX_PATH = "nixpkgs=" + pkgs.path;
};
}
);
}