-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
79 lines (76 loc) · 2.14 KB
/
flake.nix
File metadata and controls
79 lines (76 loc) · 2.14 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
78
79
{
description = "A package for mathematical smart constructors";
inputs = {
# nix
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
nix-hs-utils.url = "github:tbidne/nix-hs-utils";
# haskell
algebra-simple = {
url = "github:tbidne/algebra-simple";
inputs.flake-parts.follows = "flake-parts";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nix-hs-utils.follows = "nix-hs-utils";
};
bounds = {
url = "github:tbidne/bounds";
inputs.flake-parts.follows = "flake-parts";
inputs.nixpkgs.follows = "nixpkgs";
inputs.nix-hs-utils.follows = "nix-hs-utils";
};
};
outputs =
inputs@{
flake-parts,
nix-hs-utils,
self,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
perSystem =
{ pkgs, ... }:
let
ghc-version = "ghc9101";
hlib = pkgs.haskell.lib;
compiler = pkgs.haskell.packages."${ghc-version}".override {
overrides =
final: prev:
{ }
// nix-hs-utils.mkLibs inputs final [
"algebra-simple"
"bounds"
];
};
mkPkg =
returnShellEnv:
nix-hs-utils.mkHaskellPkg {
inherit compiler pkgs returnShellEnv;
name = "smart-math";
root = ./.;
devTools = [
(hlib.dontCheck compiler.cabal-fmt)
(hlib.dontCheck compiler.haskell-language-server)
pkgs.nixfmt-rfc-style
];
};
compilerPkgs = {
inherit compiler pkgs;
};
in
{
packages.default = mkPkg false;
devShells.default = mkPkg true;
apps = {
format = nix-hs-utils.format compilerPkgs;
#lint = nix-hs-utils.lint compilerPkgs;
#lintRefactor = nix-hs-utils.lintRefactor compilerPkgs;
};
};
systems = [
"aarch64-darwin"
"aarch64-linux"
"x86_64-darwin"
"x86_64-linux"
];
};
}