chore: init

This commit is contained in:
Nick 2025-10-01 19:51:55 -05:00
commit 1b2c1ea359
891 changed files with 37053 additions and 0 deletions

1
templates/haskell/.envrc Executable file
View file

@ -0,0 +1 @@
use flake

4
templates/haskell/.gitignore vendored Executable file
View file

@ -0,0 +1,4 @@
.direnv
.pre-commit-config.yaml
.vscode
dist-newstyle

57
templates/haskell/flake.nix Executable file
View file

@ -0,0 +1,57 @@
{
description = "Haskell Environment";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
treefmt-nix.url = "github:numtide/treefmt-nix";
};
outputs =
inputs:
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
imports = [ inputs.treefmt-nix.flakeModule ];
perSystem =
{ pkgs, ... }:
let
hp = pkgs.haskellPackages;
project = hp.callCabal2nix "project" ./. { };
in
{
devShells.default = hp.shellFor {
nativeBuildInputs = builtins.attrValues {
inherit (pkgs)
nil
stylish-haskell
ghc
;
inherit (hp)
cabal-install
cabal-gild
haskell-language-server
;
};
packages = _: [ project ];
};
packages.default = project;
treefmt = {
programs = {
cabal-fmt.enable = true;
deadnix.enable = true;
hlint.enable = true;
nixfmt.enable = true;
ormolu.enable = true;
statix.enable = true;
typstyle.enable = true;
yamlfmt.enable = true;
};
projectRootFile = "flake.nix";
};
};
systems = [ "x86_64-linux" ];
};
}

12
templates/haskell/fourmolu.yaml Executable file
View file

@ -0,0 +1,12 @@
indentation: 2
comma-style: trailing
import-export-style: diff-friendly
respectful: false
column-limit: 80
function-arrows: trailing
haddock-style: single-line
let-style: inline
in-style: right-align
unicode: never
pragma-style: leading
newlines-between-decls: 1

2
templates/haskell/justfile Executable file
View file

@ -0,0 +1,2 @@
cabal:
cabal clean ; cabal run

10
templates/haskell/project.cabal Executable file
View file

@ -0,0 +1,10 @@
cabal-version: 3.0
name: project
version: 0.1.0.0
executable main
main-is: Main.hs
build-depends:
, base
default-language: Haskell2010
hs-source-dirs: src

4
templates/haskell/src/Main.hs Executable file
View file

@ -0,0 +1,4 @@
module Main where
main :: IO ()
main = putStrLn "Hello, World!"