Initial import

This commit is contained in:
Alexander Kobjolke 2023-08-11 23:19:35 +02:00
commit babdc90cef
9 changed files with 255 additions and 0 deletions

74
flake.nix Normal file
View file

@ -0,0 +1,74 @@
{
description = "Haskell file poger (Effective Haskell)";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, pre-commit-hooks }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
haskellPackages = pkgs.haskell.packages.ghc924;
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
packageName = "hcat";
in {
packages.${packageName} = haskellPackages.callCabal2nix packageName self
rec {
# Dependency overrides go here
};
defaultPackage = self.packages.${system}.${packageName};
apps = {
# run with: nix run #.hcat
hcat = {
type = "app";
program = "${self.defaultPackage.${system}}/bin/hcat";
};
# run with: nix run
default = self.apps.${system}.hcat;
};
checks = {
pre-commit-check = pre-commit-hooks.lib.${system}.run {
src = ./.;
hooks = {
nixfmt.enable = true;
fourmolu.enable = true;
hpack.enable = true;
hlint.enable = true;
};
};
};
devShell = haskellPackages.shellFor {
inherit (self.checks.${system}.pre-commit-check) shellHook;
packages = p: [ self.defaultPackage.${system} ];
withHoogle = true;
buildInputs = with pkgs; [
haskellPackages.haskell-language-server
haskellPackages.fourmolu
cabal-install
ghcid
nixfmt
hpack
hlint
];
inputsFrom = builtins.attrValues self.packages.${system};
};
});
}