tijdelijk-te-laat/haskell/flake.nix

49 lines
1.2 KiB
Nix
Raw Normal View History

2025-04-18 13:51:02 +02:00
{
description = "A basic Haskell flake";
# To be used in conjunction with cabal2nix
2024-03-19 00:58:40 +01:00
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
2025-04-18 13:51:02 +02:00
outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
compiler = throw "add compiler version here";
in
{
packages = {
default = pkgs.haskell.packages.${compiler}.mkDerivation rec {
pname = throw "insert haskell package name here\nderived from the .cabal file";
version = "0.1.0.0";
src = ./.;
isLibrary = false;
isExecutable = true;
executableHaskellDepends = with pkgs.haskellPackages; [
base
];
license = pkgs.lib.licenses.agpl3Only;
mainProgram = pname;
};
};
2024-03-19 00:58:40 +01:00
2025-04-18 13:51:02 +02:00
devShells.default = pkgs.mkShell {
buildInputs = with pkgs.haskellPackages; [
base
cabal-install
ghc
haskell-language-server
cabal2nix
];
};
2024-03-19 00:58:40 +01:00
2025-04-18 13:51:02 +02:00
}
);
2024-03-19 00:58:40 +01:00
}