-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
28 lines (28 loc) · 814 Bytes
/
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
{
# 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 = "nixpkgs";
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;
});
in {
devShell = forAllSystems (system: let
haskellPackages = nixpkgsFor.${system}.haskellPackages;
in
haskellPackages.shellFor {
packages = p: [];
buildInputs = with haskellPackages; [
haskell-language-server
ghcid
cabal-install
];
});
};
}