-
Notifications
You must be signed in to change notification settings - Fork 11
/
flake.nix
45 lines (43 loc) · 1.34 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
{
description = "PKGNAME";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/release-24.05";
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 // {
PKGNAME = hfinal.callCabal2nix "PKGNAME" ./. { };
};
};
PKGNAME = final.haskell.lib.compose.justStaticExecutables final.haskellPackages.PKGNAME;
};
perSystem = system:
let
pkgs = import inputs.nixpkgs { inherit system; overlays = [ overlay ]; };
hspkgs = pkgs.haskellPackages;
in
{
devShells = rec {
default = PKGNAME-shell;
PKGNAME-shell = hspkgs.shellFor {
withHoogle = true;
packages = p: [ p.PKGNAME ];
buildInputs = [
hspkgs.cabal-install
hspkgs.haskell-language-server
hspkgs.hlint
hspkgs.ormolu
pkgs.bashInteractive
];
};
};
packages = rec {
default = PKGNAME;
PKGNAME = pkgs.PKGNAME;
};
};
in
{ inherit overlay; } // inputs.flake-utils.lib.eachDefaultSystem perSystem;
}