-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathflake.nix
More file actions
49 lines (47 loc) · 2.16 KB
/
flake.nix
File metadata and controls
49 lines (47 loc) · 2.16 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
{
description = "A collection of libraries for mathematical programming";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
haskellPackages = pkgs.haskellPackages.override {
overrides = self: super: {
examples = self.callCabal2nix "examples" ./examples {};
glpk-headers = self.callCabal2nix "glpk-headers" ./glpk-headers {};
math-programming = self.callCabal2nix "math-programming" ./math-programming {};
math-programming-glpk = self.callCabal2nix "math-programming-glpk" ./math-programming-glpk {};
math-programming-tests = self.callCabal2nix "math-programming-tests" ./math-programming-tests {};
};
};
in
{
packages.examples = haskellPackages.examples;
packages.glpk-headers = haskellPackages.glpk-headers;
packages.math-programming = haskellPackages.mathProgramming;
packages.math-programming-glpk = haskellPackages.mathProgrammingGlpk;
packages.math-programming-tests = haskellPackages.mathProgrammingTests;
packages.default = self.packages.${system}.examples;
defaultPackage = self.packages.${system}.default;
devShells.default = pkgs.haskellPackages.shellFor {
packages = p: [ haskellPackages.examples
haskellPackages.glpk-headers
haskellPackages.math-programming
haskellPackages.math-programming-glpk
haskellPackages.math-programming-tests
];
buildInputs = [
pkgs.haskellPackages.haskell-language-server
pkgs.ormolu
pkgs.cabal-install
];
withHoogle = true;
doBenchmark = true;
};
devShell = self.devShells.${system}.default;
}
);
}