-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathflake.nix
57 lines (54 loc) · 1.9 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
{
description = "Data frames for tabular data.";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let pkg-name = "Frames";
pkgs = import nixpkgs {
inherit system;
config = { allowBroken = true; };
};
haskell = pkgs.haskellPackages;
haskell-overlay = final: prev:
let overrideSrc = pkgs.haskell.lib.overrideSrc;
appendConfigureFlags = pkgs.haskell.lib.appendConfigureFlags;
overrideCabal = pkgs.haskell.lib.overrideCabal;
enableCabalFlag = pkgs.haskell.lib.enableCabalFlag;
in {
${pkg-name} =
hspkgs.callCabal2nixWithOptions pkg-name ./. "-fdemos" {};
# enableCabalFlag (hspkgs.callCabal2nix pkg-name ./. {}) "demos";
# (hspkgs.callCabal2nix pkg-name ./. {}).overrideAttrs(old: {
# configureFlags = (old.configureFlags or []) ++ ["-fdemos"];
# });
# Add here any package overrides you may need
};
hspkgs = haskell.override {
overrides = haskell-overlay;
};
in {
packages = pkgs;
apps.init = pkgs.writeShellApplication {
name = "cabal-init";
runtimeInputs = [hspkgs.ghc hspkgs.cabal-install];
text = ''
cabal init -p ${pkg-name}
'';
};
inherit haskell-overlay;
defaultPackage = hspkgs.${pkg-name};
devShell = hspkgs.shellFor {
packages = p: [p.${pkg-name}];
root = ./.;
withHoogle = true;
buildInputs = with hspkgs; [
haskell-language-server
cabal-install
];
};
}
);
}