-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
42 lines (39 loc) · 1.31 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
{
# inspired by: https://serokell.io/blog/practical-nix-flakes#packaging-existing-applications
# description = "A Hello World in Haskell with a dependency and a devShell";
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
outputs = { self, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" ];
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
});
in
{
overlays.default = (final: prev: {
bigball = final.haskellPackages.callCabal2nix "bigball" ./. { };
});
packages = forAllSystems (system: {
bigball = nixpkgsFor.${system}.bigball;
default = self.packages.${system}.bigball;
});
checks = self.packages;
devShells = forAllSystems (system:
let haskellPackages = nixpkgsFor.${system}.haskellPackages;
in
{
default = haskellPackages.shellFor {
packages = p: [ self.packages.${system}.bigball ];
withHoogle = true;
buildInputs = with haskellPackages; [
haskell-language-server
ghcid
cabal-install
];
};
}
);
};
}