-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
49 lines (47 loc) · 1.72 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
{
description = "Environment for BellKAT";
inputs.nixpkgs.url = "github:pschuprikov/nixpkgs/nixos-23.05";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
lib = nixpkgs.lib;
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
in {
packages.default = pkgs.haskellPackages.bellkat;
packages.bellkatGHC =
pkgs.haskellPackages.ghcWithPackages (ps: [ ps.bellkat ]);
packages.bellkatGHCWithFC = pkgs.runCommand "bellkatghc-with-fc" {
buildInputs = [ pkgs.makeWrapper ];
} ''
mkdir -p $out/bin
makeWrapper ${
self.packages.${system}.bellkatGHC
}/bin/runhaskell $out/bin/runhaskell \
--set FONTCONFIG_FILE "${pkgs.fontconfig.out}/etc/fonts/fonts.conf" \
--set FONTCONFIG_PATH "${pkgs.fontconfig.out}/etc/fonts/"
'';
devShells.default = pkgs.haskellPackages.shellFor {
FONTCONFIG_FILE = "${pkgs.fontconfig.out}/etc/fonts/fonts.conf";
FONTCONFIG_PATH = "${pkgs.fontconfig.out}/etc/fonts/";
buildInputs = [
pkgs.ghcid
pkgs.cabal-install
pkgs.haskellPackages.haskell-language-server
];
packages = ps: [ ps.bellkat ];
};
}) // {
overlays = {
default = final: prev: {
haskellPackages = prev.haskellPackages.extend (hself: hsuper: {
bellkat = hself.callCabal2nix "bellkat"
(prev.lib.sourceFilesBySuffices ./. [ ".hs" ".yaml" ]) { };
});
};
};
};
}