feat: init

This commit is contained in:
Nick 2025-03-29 23:08:26 -05:00
commit 96c6f790fc
804 changed files with 33411 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

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

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

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

@ -0,0 +1,21 @@
{
inputs = {
haskell-flake.url = "github:srid/haskell-flake";
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
pre-commit-hooks-nix.url = "github:cachix/pre-commit-hooks.nix";
};
outputs = inputs @ {
self,
nixpkgs,
flake-parts,
...
}:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
inputs.haskell-flake.flakeModule
inputs.pre-commit-hooks-nix.flakeModule
./parts
];
systems = nixpkgs.lib.systems.flakeExposed;
};
}

0
templates/haskell/justfile Executable file
View file

View file

@ -0,0 +1,45 @@
{
pkgs,
config,
...
}:
{
haskellProjects.default = {
devShell = {
enable = true;
tools = hp: {
inherit (hp)
cabal-fmt
haskell-language-server
;
inherit (pkgs)
dhall
dhall-json
dhall-lsp-server
helix-gpt
age
just
nil
nixd
sops
ssh-to-age
nixfmt-rfc-style
libz
ngrep
stripe-cli
vscode-langservers-extracted
zlib
;
inherit (pkgs.haskellPackages)
nixfmt
;
};
hlsCheck.enable = true;
mkShellArgs.shellHook = "${config.pre-commit.installationScript}";
};
};
}

View file

@ -0,0 +1 @@
{self, ...}: {packages.default = self.packages.example;}

View file

@ -0,0 +1,7 @@
{
pre-commit.settings.hooks = {
nixfmt.enable = true;
commitizen.enable = true;
statix.enable = true;
};
}

View file

@ -0,0 +1,20 @@
{
perSystem = {
pkgs,
lib,
config,
self',
...
}: let
configPath = ./config;
devshellImports = let
files = builtins.attrNames (builtins.readDir configPath);
in
map
(name: configPath + "/${name}")
(builtins.filter (name: builtins.match ".*\\.nix$" name != null) files);
in {
imports = devshellImports;
};
}

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

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