feat: haskell added

This commit is contained in:
Artur Manuel 2024-09-07 16:33:54 +01:00
commit 71c63a89e2
Failed to generate hash of commit
18 changed files with 161 additions and 102 deletions

1
.gitignore vendored
View file

@ -3,3 +3,4 @@
**/result **/result
**/result-* **/result-*
**/.direnv **/.direnv
**/dist

View 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
View 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.

View file

@ -0,0 +1,3 @@
main :: IO ()
main = do
putStrLn "Hello World!"

View 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
View 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
}

View 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);
};
}

View file

@ -0,0 +1,4 @@
{ haskellPackages }:
haskellPackages.developPackage {
root = ../.;
}

View file

@ -0,0 +1,9 @@
{ haskellPackages }: {
packages = builtins.attrValues {
inherit (haskellPackages)
haskell-language-server
ormolu
ghc
;
};
}

View file

@ -0,0 +1,5 @@
_: {
projectRootFile = "flake.nix";
programs.nixfmt.enable = true;
programs.ormolu.enable = true;
}

View file

@ -1 +0,0 @@
**/result

View file

@ -1 +0,0 @@
remember to change python-app to whatever you please!

View file

@ -1,27 +0,0 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1722987190,
"narHash": "sha256-68hmex5efCiM2aZlAAEcQgmFI4ZwWt8a80vOeB/5w3A=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "21cc704b5e918c5fbf4f9fff22b4ac2681706d90",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

View file

@ -1,26 +0,0 @@
{
description = "Python flake";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
};
outputs = { self, nixpkgs }:
let
systems = [ "x86_64-linux" "aarch64-linux" ];
forAllSystems = nixpkgs.lib.genAttrs systems;
pkgsForEach = nixpkgs.legacyPackages;
in
{
packages = forAllSystems (system: {
default = pkgsForEach.${system}.callPackage ./nix/package.nix { };
python-app = self.packages.${system}.default;
});
devShells = forAllSystems (system: {
default = pkgsForEach.${system}.callPackage ./nix/shell.nix {
inherit (self.packages.${system}) python-app;
};
});
};
}

View file

@ -1,16 +0,0 @@
{ python3Packages }:
let
pname = "python-app";
version = "0.1.0";
inherit (python3Packages)
buildPythonApplication
flask
;
in
buildPythonApplication {
inherit pname version;
propagatedBuildInputs = [
flask
];
src = ../${pname};
}

View file

@ -1,9 +0,0 @@
{ mkShell, python-app, python312Packages }:
mkShell {
name = "Python Palace";
inputsFrom = [ python-app ];
nativeBuildInputs = [
python312Packages.ruff-lsp
python312Packages.ruff
];
}

View file

@ -1,11 +0,0 @@
#!/usr/bin/env python
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
if __name__ == '__main__':
app.run(host="0.0.0.0", port=8080)

View file

@ -1,11 +0,0 @@
#!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='python-app',
version='0.1.0',
# Modules to import from other scripts:
packages=find_packages(),
# Executables
scripts=["python-app"],
)