Cabal updates

This commit is contained in:
James Eversole 2024-10-16 15:54:34 -05:00
parent ffec891f26
commit b39e9cefd6
4 changed files with 52 additions and 31 deletions

View File

@ -1,4 +1,4 @@
cabal-version: 1.12
cabal-version: 3.0
name: HELPS
version: 0.0.1
@ -9,13 +9,27 @@ copyright: James Eversole
license: ISC
license-file: LICENSE
build-type: Simple
with-compiler: ghc-9.6.6
documentation: True
extra-source-files:
README
executable Main
main-is: Main.hs
hs-source-dirs:
src
common global
build-depends:
base
, aeson
, bytestring
, effectful
, exceptions
, lucid
, mtl
, postgresql-simple
, resource-pool
, servant-server
, text
, time
, utf8-string
, warp
default-extensions:
BlockArguments
ConstraintKinds
@ -31,25 +45,24 @@ executable Main
StrictData
TypeFamilies
ghc-options: -threaded -rtsopts -with-rtsopts=-N -optl-pthread -fPIC
build-depends:
base
, aeson
, bytestring
, effectful
, exceptions
, lucid
, mtl
, postgresql-simple
, resource-pool
, servant-server
, text
, time
, utf8-string
, warp
default-language: GHC2021
executable Main
import: global
hs-source-dirs:
src
main-is: Main.hs
other-modules:
Core
Database
Handlers
Logger
Routes
default-language: GHC2021
build-depends:
HELPS
library
import: global
hs-source-dirs:
src
exposed-modules: Core, Database, Handlers, Logger, Routes

View File

@ -12,24 +12,29 @@
packageName = "HELPS";
containerPackageName = "${packageName}-container";
c2n = haskellPackages.callCabal2nix packageName self rec {};
HELPS = c2n.overrideAttrs (old: {
doHaddock = true;
enableSeparateDocOutput = false;
enableSharedExecutables = false;
enableSharedLibraries = false;
});
haskellPackages = pkgs.haskellPackages;
enableSharedExecutables = false;
enableSharedLibraries = false;
HELPS = pkgs.haskell.lib.justStaticExecutables self.packages.${system}.default;
in {
packages.${packageName} =
haskellPackages.callCabal2nix packageName self rec {};
packages.${packageName} = pkgs.haskell.lib.justStaticExecutables HELPS;
packages.HELPSDocs = HELPS;
packages.default = self.packages.${system}.${packageName};
defaultPackage = self.packages.${system}.default;
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
ghcid
cabal-install
ghc
self.packages.${system}.default
pkgs.haskellPackages.cabal-install
pkgs.haskellPackages.ghc
pkgs.haskellPackages.ghcid
pkgs.haskellPackages.haskell-language-server
];
inputsFrom = builtins.attrValues self.packages.${system};
};

1
result Symbolic link
View File

@ -0,0 +1 @@
/nix/store/mjqr6gajan8a4nmhl4s6khq4lf6phrf3-HELPS-0.0.1

View File

@ -68,7 +68,9 @@ data LogLevel = Info | Warning | Error
instance ToField LogLevel where
toField level = toField (T.pack (show level))
--
-- Utility
--
liftIOE :: (IOE :> es, Error ServerError :> es) => IO a -> Eff es a
-- Lift IO into Eff and catch IOExceptions
liftIOE m = liftIO m `catch` \(e::IOException) -> do