From d861689bba83836210f2559b16d7a35969dc57f7 Mon Sep 17 00:00:00 2001 From: Dmitry Zuikov Date: Tue, 10 Jan 2023 09:20:05 +0300 Subject: [PATCH] init --- .envrc | 1 + .gitignore | 2 + cabal.project | 2 + flake.lock | 118 ++++++++++++++++++ flake.nix | 54 ++++++++ hbs2-core/CHANGELOG.md | 5 + hbs2-core/LICENSE | 30 +++++ hbs2-core/hbs2-core.cabal | 26 ++++ hbs2-core/lib/MyLib.hs | 4 + hbs2-storage-simple/CHANGELOG.md | 5 + hbs2-storage-simple/LICENSE | 30 +++++ hbs2-storage-simple/hbs2-storage-simple.cabal | 26 ++++ hbs2-storage-simple/lib/MyLib.hs | 4 + hie.yaml | 2 + 14 files changed, 309 insertions(+) create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 cabal.project create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 hbs2-core/CHANGELOG.md create mode 100644 hbs2-core/LICENSE create mode 100644 hbs2-core/hbs2-core.cabal create mode 100644 hbs2-core/lib/MyLib.hs create mode 100644 hbs2-storage-simple/CHANGELOG.md create mode 100644 hbs2-storage-simple/LICENSE create mode 100644 hbs2-storage-simple/hbs2-storage-simple.cabal create mode 100644 hbs2-storage-simple/lib/MyLib.hs create mode 100644 hie.yaml diff --git a/.envrc b/.envrc new file mode 100644 index 00000000..3550a30f --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..0753cd2d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +dist-newstyle +.direnv/ diff --git a/cabal.project b/cabal.project new file mode 100644 index 00000000..4ae153ca --- /dev/null +++ b/cabal.project @@ -0,0 +1,2 @@ +packages: **/*.cabal + diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..c10fa0c3 --- /dev/null +++ b/flake.lock @@ -0,0 +1,118 @@ +{ + "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1644229661, + "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "haskell-flake-utils": { + "inputs": { + "flake-utils": "flake-utils" + }, + "locked": { + "lastModified": 1672412555, + "narHash": "sha256-Kaa8F7nQFR3KuS6Y9WRUxeJeZlp6CCubyrRfmiEsW4k=", + "owner": "ivanovs-4", + "repo": "haskell-flake-utils", + "rev": "896219e5bde6efac72198550454e9dd9b5ed9ac9", + "type": "github" + }, + "original": { + "owner": "ivanovs-4", + "repo": "haskell-flake-utils", + "rev": "896219e5bde6efac72198550454e9dd9b5ed9ac9", + "type": "github" + } + }, + "haskell-flake-utils_2": { + "inputs": { + "flake-utils": "flake-utils_2" + }, + "locked": { + "lastModified": 1672412555, + "narHash": "sha256-Kaa8F7nQFR3KuS6Y9WRUxeJeZlp6CCubyrRfmiEsW4k=", + "owner": "ivanovs-4", + "repo": "haskell-flake-utils", + "rev": "896219e5bde6efac72198550454e9dd9b5ed9ac9", + "type": "github" + }, + "original": { + "owner": "ivanovs-4", + "repo": "haskell-flake-utils", + "rev": "896219e5bde6efac72198550454e9dd9b5ed9ac9", + "type": "github" + } + }, + "hspup": { + "inputs": { + "haskell-flake-utils": "haskell-flake-utils_2", + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1672641093, + "narHash": "sha256-v0Uj3gkDWPdnXZUKpJGD7RxIOncTexhN0csIop36yug=", + "owner": "voidlizard", + "repo": "hspup", + "rev": "031d27dea1505fd68cd603da7e72eb5eefd348fd", + "type": "github" + }, + "original": { + "owner": "voidlizard", + "repo": "hspup", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1673163619, + "narHash": "sha256-B33PFBL64ZgTWgMnhFL3jgheAN/DjHPsZ1Ih3z0VE5I=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "8c54d842d9544361aac5f5b212ba04e4089e8efe", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-22.11", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "haskell-flake-utils": "haskell-flake-utils", + "hspup": "hspup", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..8f2da3c5 --- /dev/null +++ b/flake.nix @@ -0,0 +1,54 @@ +{ +description = "hbs2"; + +inputs = { + + nixpkgs.url = "github:nixos/nixpkgs/nixos-22.11"; + # haskell-flake-utils.url = "github:ivanovs-4/haskell-flake-utils"; + haskell-flake-utils.url = "github:ivanovs-4/haskell-flake-utils/896219e5bde6efac72198550454e9dd9b5ed9ac9"; + hspup.url = "github:voidlizard/hspup"; + hspup.inputs.nixpkgs.follows = "nixpkgs"; +}; + +outputs = { self, nixpkgs, haskell-flake-utils, ... }@inputs: + + haskell-flake-utils.lib.simpleCabalProject2flake { + inherit self nixpkgs; + systems = [ "x86_64-linux" ]; + name = "hbs2-core"; + + packageNames = [ + "hbs2-core" + "hbs2-storage-simple" + ]; + + packageDirs = { + "hbs2-core" = "./hbs2-core"; + "hbs2-storage-simple" = "./hbs2-storage-simple"; + }; + + + packagePostOverrides = { pkgs }: with pkgs; with haskell.lib; [ + disableExecutableProfiling + disableLibraryProfiling + dontBenchmark + dontCoverage + dontDistribute + dontHaddock + dontHyperlinkSource + doStrip + enableDeadCodeElimination + justStaticExecutables + + dontCheck + ]; + + shellExtBuildInputs = {pkgs}: with pkgs; [ + haskellPackages.haskell-language-server + inputs.hspup.packages.${pkgs.system}.default + ]; + + }; + + +} diff --git a/hbs2-core/CHANGELOG.md b/hbs2-core/CHANGELOG.md new file mode 100644 index 00000000..4ffba7ba --- /dev/null +++ b/hbs2-core/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for hbs2-core + +## 0.1.0.0 -- YYYY-mm-dd + +* First version. Released on an unsuspecting world. diff --git a/hbs2-core/LICENSE b/hbs2-core/LICENSE new file mode 100644 index 00000000..3cbe915d --- /dev/null +++ b/hbs2-core/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2023, + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/hbs2-core/hbs2-core.cabal b/hbs2-core/hbs2-core.cabal new file mode 100644 index 00000000..7cd78859 --- /dev/null +++ b/hbs2-core/hbs2-core.cabal @@ -0,0 +1,26 @@ +cabal-version: 3.0 +name: hbs2-core +version: 0.1.0.0 +-- synopsis: +-- description: +license: BSD-3-Clause +license-file: LICENSE +-- author: +-- maintainer: +-- copyright: +category: Network +build-type: Simple +extra-doc-files: CHANGELOG.md +-- extra-source-files: + +common warnings + ghc-options: -Wall + +library + import: warnings + exposed-modules: MyLib + -- other-modules: + -- other-extensions: + build-depends: base ^>=4.15.1.0 + hs-source-dirs: lib + default-language: Haskell2010 diff --git a/hbs2-core/lib/MyLib.hs b/hbs2-core/lib/MyLib.hs new file mode 100644 index 00000000..e657c440 --- /dev/null +++ b/hbs2-core/lib/MyLib.hs @@ -0,0 +1,4 @@ +module MyLib (someFunc) where + +someFunc :: IO () +someFunc = putStrLn "someFunc" diff --git a/hbs2-storage-simple/CHANGELOG.md b/hbs2-storage-simple/CHANGELOG.md new file mode 100644 index 00000000..bcb9d67c --- /dev/null +++ b/hbs2-storage-simple/CHANGELOG.md @@ -0,0 +1,5 @@ +# Revision history for hbs2-storage-simple + +## 0.1.0.0 -- YYYY-mm-dd + +* First version. Released on an unsuspecting world. diff --git a/hbs2-storage-simple/LICENSE b/hbs2-storage-simple/LICENSE new file mode 100644 index 00000000..3cbe915d --- /dev/null +++ b/hbs2-storage-simple/LICENSE @@ -0,0 +1,30 @@ +Copyright (c) 2023, + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * Neither the name of nor the names of other + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/hbs2-storage-simple/hbs2-storage-simple.cabal b/hbs2-storage-simple/hbs2-storage-simple.cabal new file mode 100644 index 00000000..14fadcc8 --- /dev/null +++ b/hbs2-storage-simple/hbs2-storage-simple.cabal @@ -0,0 +1,26 @@ +cabal-version: 3.0 +name: hbs2-storage-simple +version: 0.1.0.0 +-- synopsis: +-- description: +license: BSD-3-Clause +license-file: LICENSE +-- author: +-- maintainer: +-- copyright: +category: Database +build-type: Simple +extra-doc-files: CHANGELOG.md +-- extra-source-files: + +common warnings + ghc-options: -Wall + +library + import: warnings + exposed-modules: MyLib + -- other-modules: + -- other-extensions: + build-depends: base ^>=4.15.1.0 + hs-source-dirs: lib + default-language: Haskell2010 diff --git a/hbs2-storage-simple/lib/MyLib.hs b/hbs2-storage-simple/lib/MyLib.hs new file mode 100644 index 00000000..e657c440 --- /dev/null +++ b/hbs2-storage-simple/lib/MyLib.hs @@ -0,0 +1,4 @@ +module MyLib (someFunc) where + +someFunc :: IO () +someFunc = putStrLn "someFunc" diff --git a/hie.yaml b/hie.yaml new file mode 100644 index 00000000..04cd2439 --- /dev/null +++ b/hie.yaml @@ -0,0 +1,2 @@ +cradle: + cabal: