fix: actually add haskell
This commit is contained in:
parent
71c63a89e2
commit
b5f8727837
11 changed files with 5 additions and 25 deletions
5
templates/haskell/CHANGELOG.md
Normal file
5
templates/haskell/CHANGELOG.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
# Revision history for cool-haskell-project
|
||||
|
||||
## 0.1.0.0 -- YYYY-mm-dd
|
||||
|
||||
* First version. Released on an unsuspecting world.
|
14
templates/haskell/LICENSE
Normal file
14
templates/haskell/LICENSE
Normal file
|
@ -0,0 +1,14 @@
|
|||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
|
3
templates/haskell/app/Main.hs
Normal file
3
templates/haskell/app/Main.hs
Normal file
|
@ -0,0 +1,3 @@
|
|||
main :: IO ()
|
||||
main = do
|
||||
putStrLn "Hello World!"
|
25
templates/haskell/cool-haskell-project.cabal
Normal file
25
templates/haskell/cool-haskell-project.cabal
Normal file
|
@ -0,0 +1,25 @@
|
|||
cabal-version: 3.0
|
||||
name: cool-haskell-project
|
||||
version: 0.1.0.0
|
||||
-- synopsis:
|
||||
-- description:
|
||||
license: WTFPL
|
||||
license-file: LICENSE
|
||||
author: Artur Manuel
|
||||
maintainer: balkenix@outlook.com
|
||||
-- copyright:
|
||||
build-type: Simple
|
||||
extra-doc-files: CHANGELOG.md
|
||||
-- extra-source-files:
|
||||
|
||||
common warnings
|
||||
ghc-options: -Wall
|
||||
|
||||
executable cool-haskell-project
|
||||
import: warnings
|
||||
main-is: Main.hs
|
||||
-- other-modules:
|
||||
-- other-extensions:
|
||||
build-depends: base ^>=4.18.2.1
|
||||
hs-source-dirs: app
|
||||
default-language: GHC2021
|
62
templates/haskell/flake.lock
generated
Normal file
62
templates/haskell/flake.lock
generated
Normal file
|
@ -0,0 +1,62 @@
|
|||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1725407940,
|
||||
"narHash": "sha256-tiN5Rlg/jiY0tyky+soJZoRzLKbPyIdlQ77xVgREDNM=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "6f6c45b5134a8ee2e465164811e451dcb5ad86e3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-24.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs_2": {
|
||||
"locked": {
|
||||
"lastModified": 1725103162,
|
||||
"narHash": "sha256-Ym04C5+qovuQDYL/rKWSR+WESseQBbNAe5DsXNx5trY=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "12228ff1752d7b7624a54e9c1af4b222b3c1073b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs",
|
||||
"treefmt": "treefmt"
|
||||
}
|
||||
},
|
||||
"treefmt": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs_2"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1725271838,
|
||||
"narHash": "sha256-VcqxWT0O/gMaeWTTjf1r4MOyG49NaNxW4GHTO3xuThE=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "9fb342d14b69aefdf46187f6bb80a4a0d97007cd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
33
templates/haskell/flake.nix
Normal file
33
templates/haskell/flake.nix
Normal file
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
description = "Cool Haskell Project with an unknown purpose";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
|
||||
treefmt.url = "github:numtide/treefmt-nix";
|
||||
};
|
||||
outputs =
|
||||
inputs@{ nixpkgs, ... }:
|
||||
let
|
||||
lib = nixpkgs.lib;
|
||||
systems = [ "x86_64-linux" ];
|
||||
forAllSystems =
|
||||
f:
|
||||
lib.genAttrs systems (
|
||||
system:
|
||||
f {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
};
|
||||
}
|
||||
);
|
||||
treefmtEval = forAllSystems ({ pkgs }: inputs.treefmt.lib.evalModule pkgs ./flake/treefmt.nix);
|
||||
in
|
||||
{
|
||||
packages = forAllSystems ({ pkgs }: {
|
||||
cool-haskell-project = pkgs.callPackage ./flake/package.nix {};
|
||||
});
|
||||
devShells = forAllSystems ({ pkgs }: {
|
||||
default = pkgs.callPackage ./flake/shell.nix {};
|
||||
});
|
||||
formatter = forAllSystems ({ pkgs }: treefmtEval.${pkgs.system}.config.build.wrapper);
|
||||
};
|
||||
}
|
4
templates/haskell/flake/package.nix
Normal file
4
templates/haskell/flake/package.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{ haskellPackages }:
|
||||
haskellPackages.developPackage {
|
||||
root = ../.;
|
||||
}
|
9
templates/haskell/flake/shell.nix
Normal file
9
templates/haskell/flake/shell.nix
Normal file
|
@ -0,0 +1,9 @@
|
|||
{ haskellPackages }: {
|
||||
packages = builtins.attrValues {
|
||||
inherit (haskellPackages)
|
||||
haskell-language-server
|
||||
ormolu
|
||||
ghc
|
||||
;
|
||||
};
|
||||
}
|
5
templates/haskell/flake/treefmt.nix
Normal file
5
templates/haskell/flake/treefmt.nix
Normal file
|
@ -0,0 +1,5 @@
|
|||
_: {
|
||||
projectRootFile = "flake.nix";
|
||||
programs.nixfmt.enable = true;
|
||||
programs.ormolu.enable = true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue