-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
44 lines (41 loc) · 1.37 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
{
description =
"Development environment and build outputs for a GameBoy emulator";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = inputs@{ self, ... }:
inputs.flake-utils.lib.eachDefaultSystem (system:
let
overlays = [
(final: prev: { haskellPackages = prev.haskell.packages.ghc96; })
self.overlays.default
];
pkgs = import inputs.nixpkgs { inherit system overlays; };
in {
formatter = pkgs.alejandra;
devShells.default = pkgs.haskellPackages.shellFor {
packages = p: [ p.game-boy-emulator-hs ];
nativeBuildInputs = [
pkgs.alejandra
pkgs.cabal-install
pkgs.haskellPackages.haskell-language-server
pkgs.haskellPackages.cabal-fmt
pkgs.haskellPackages.fourmolu
];
};
}) // {
overlays.default = final: prev: {
haskellPackages = prev.haskellPackages.override (old: {
overrides =
final.lib.composeExtensions (old.overrides or (_: _: { }))
(hfinal: hprev: {
game-boy-emulator-hs =
hfinal.callCabal2nix "game-boy-emulator-hs"
(final.lib.cleanSource ./.) { };
});
});
};
};
}