Cabal updates
This commit is contained in:
parent
ffec891f26
commit
b39e9cefd6
55
HELPS.cabal
55
HELPS.cabal
@ -1,4 +1,4 @@
|
|||||||
cabal-version: 1.12
|
cabal-version: 3.0
|
||||||
|
|
||||||
name: HELPS
|
name: HELPS
|
||||||
version: 0.0.1
|
version: 0.0.1
|
||||||
@ -9,28 +9,12 @@ copyright: James Eversole
|
|||||||
license: ISC
|
license: ISC
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
|
with-compiler: ghc-9.6.6
|
||||||
|
documentation: True
|
||||||
extra-source-files:
|
extra-source-files:
|
||||||
README
|
README
|
||||||
|
|
||||||
executable Main
|
common global
|
||||||
main-is: Main.hs
|
|
||||||
hs-source-dirs:
|
|
||||||
src
|
|
||||||
default-extensions:
|
|
||||||
BlockArguments
|
|
||||||
ConstraintKinds
|
|
||||||
DataKinds
|
|
||||||
DeriveGeneric
|
|
||||||
DerivingStrategies
|
|
||||||
FlexibleContexts
|
|
||||||
FlexibleInstances
|
|
||||||
LambdaCase
|
|
||||||
OverloadedRecordDot
|
|
||||||
OverloadedStrings
|
|
||||||
ScopedTypeVariables
|
|
||||||
StrictData
|
|
||||||
TypeFamilies
|
|
||||||
ghc-options: -threaded -rtsopts -with-rtsopts=-N -optl-pthread -fPIC
|
|
||||||
build-depends:
|
build-depends:
|
||||||
base
|
base
|
||||||
, aeson
|
, aeson
|
||||||
@ -46,10 +30,39 @@ executable Main
|
|||||||
, time
|
, time
|
||||||
, utf8-string
|
, utf8-string
|
||||||
, warp
|
, warp
|
||||||
|
default-extensions:
|
||||||
|
BlockArguments
|
||||||
|
ConstraintKinds
|
||||||
|
DataKinds
|
||||||
|
DeriveGeneric
|
||||||
|
DerivingStrategies
|
||||||
|
FlexibleContexts
|
||||||
|
FlexibleInstances
|
||||||
|
LambdaCase
|
||||||
|
OverloadedRecordDot
|
||||||
|
OverloadedStrings
|
||||||
|
ScopedTypeVariables
|
||||||
|
StrictData
|
||||||
|
TypeFamilies
|
||||||
|
ghc-options: -threaded -rtsopts -with-rtsopts=-N -optl-pthread -fPIC
|
||||||
|
default-language: GHC2021
|
||||||
|
|
||||||
|
executable Main
|
||||||
|
import: global
|
||||||
|
hs-source-dirs:
|
||||||
|
src
|
||||||
|
main-is: Main.hs
|
||||||
other-modules:
|
other-modules:
|
||||||
Core
|
Core
|
||||||
Database
|
Database
|
||||||
Handlers
|
Handlers
|
||||||
Logger
|
Logger
|
||||||
Routes
|
Routes
|
||||||
default-language: GHC2021
|
build-depends:
|
||||||
|
HELPS
|
||||||
|
|
||||||
|
library
|
||||||
|
import: global
|
||||||
|
hs-source-dirs:
|
||||||
|
src
|
||||||
|
exposed-modules: Core, Database, Handlers, Logger, Routes
|
||||||
|
25
flake.nix
25
flake.nix
@ -12,24 +12,29 @@
|
|||||||
packageName = "HELPS";
|
packageName = "HELPS";
|
||||||
containerPackageName = "${packageName}-container";
|
containerPackageName = "${packageName}-container";
|
||||||
|
|
||||||
|
c2n = haskellPackages.callCabal2nix packageName self rec {};
|
||||||
|
HELPS = c2n.overrideAttrs (old: {
|
||||||
|
doHaddock = true;
|
||||||
|
enableSeparateDocOutput = false;
|
||||||
|
enableSharedExecutables = false;
|
||||||
|
enableSharedLibraries = false;
|
||||||
|
});
|
||||||
|
|
||||||
haskellPackages = pkgs.haskellPackages;
|
haskellPackages = pkgs.haskellPackages;
|
||||||
|
|
||||||
enableSharedExecutables = false;
|
|
||||||
enableSharedLibraries = false;
|
|
||||||
|
|
||||||
HELPS = pkgs.haskell.lib.justStaticExecutables self.packages.${system}.default;
|
|
||||||
in {
|
in {
|
||||||
packages.${packageName} =
|
packages.${packageName} = pkgs.haskell.lib.justStaticExecutables HELPS;
|
||||||
haskellPackages.callCabal2nix packageName self rec {};
|
packages.HELPSDocs = HELPS;
|
||||||
|
|
||||||
packages.default = self.packages.${system}.${packageName};
|
packages.default = self.packages.${system}.${packageName};
|
||||||
defaultPackage = self.packages.${system}.default;
|
defaultPackage = self.packages.${system}.default;
|
||||||
|
|
||||||
devShells.default = pkgs.mkShell {
|
devShells.default = pkgs.mkShell {
|
||||||
buildInputs = with pkgs; [
|
buildInputs = with pkgs; [
|
||||||
ghcid
|
self.packages.${system}.default
|
||||||
cabal-install
|
pkgs.haskellPackages.cabal-install
|
||||||
ghc
|
pkgs.haskellPackages.ghc
|
||||||
|
pkgs.haskellPackages.ghcid
|
||||||
|
pkgs.haskellPackages.haskell-language-server
|
||||||
];
|
];
|
||||||
inputsFrom = builtins.attrValues self.packages.${system};
|
inputsFrom = builtins.attrValues self.packages.${system};
|
||||||
};
|
};
|
||||||
|
1
result
Symbolic link
1
result
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
/nix/store/mjqr6gajan8a4nmhl4s6khq4lf6phrf3-HELPS-0.0.1
|
@ -68,7 +68,9 @@ data LogLevel = Info | Warning | Error
|
|||||||
instance ToField LogLevel where
|
instance ToField LogLevel where
|
||||||
toField level = toField (T.pack (show level))
|
toField level = toField (T.pack (show level))
|
||||||
|
|
||||||
|
--
|
||||||
-- Utility
|
-- Utility
|
||||||
|
--
|
||||||
liftIOE :: (IOE :> es, Error ServerError :> es) => IO a -> Eff es a
|
liftIOE :: (IOE :> es, Error ServerError :> es) => IO a -> Eff es a
|
||||||
-- Lift IO into Eff and catch IOExceptions
|
-- Lift IO into Eff and catch IOExceptions
|
||||||
liftIOE m = liftIO m `catch` \(e::IOException) -> do
|
liftIOE m = liftIO m `catch` \(e::IOException) -> do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user