-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
50 lines (48 loc) · 1.65 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
{
description = "tasty-tutorial";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = inputs:
let
overlay = final: prev: {
haskell = prev.haskell // {
packageOverrides = hfinal: hprev:
prev.haskell.packageOverrides hfinal hprev // {
tastyTutorial = hfinal.callCabal2nix "tasty-tutorial" ./. { };
};
};
tastyTutorial = final.haskell.lib.compose.justStaticExecutables final.haskellPackages.tastyTutorial;
};
perSystem = system:
let
pkgs = import inputs.nixpkgs { inherit system; overlays = [ overlay ]; config = { allowUnfree = true; };};
hspkgs = pkgs.haskellPackages;
in
{
devShell = hspkgs.shellFor {
withHoogle = true;
packages = p: [ p.tastyTutorial ];
buildInputs = [
hspkgs.cabal-install
hspkgs.haskell-language-server
hspkgs.hlint
hspkgs.ormolu
pkgs.bashInteractive
(pkgs.vscode-with-extensions.override {
vscode = pkgs.vscodium;
vscodeExtensions = with pkgs.vscode-extensions; [
dracula-theme.theme-dracula
haskell.haskell
jnoortheen.nix-ide
justusadam.language-haskell
mkhl.direnv
];
}
)
];
};
defaultPackage = pkgs.tastyTutorial;
};
in
{ inherit overlay; } // inputs.flake-utils.lib.eachDefaultSystem perSystem;
}