Compare commits
No commits in common. "uni2work" and "master" have entirely different histories.
44
flake.lock
44
flake.lock
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"nodes": {
|
|
||||||
"flake-utils": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1619345332,
|
|
||||||
"narHash": "sha256-qHnQkEp1uklKTpx3MvKtY6xzgcqXDsz5nLilbbuL+3A=",
|
|
||||||
"owner": "numtide",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"rev": "2ebf2558e5bf978c7fb8ea927dfaed8fefab2e28",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "numtide",
|
|
||||||
"ref": "master",
|
|
||||||
"repo": "flake-utils",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1620323686,
|
|
||||||
"narHash": "sha256-+gfcE3YTGl+Osc8HzOUXSFO8/0PAK4J8ZxCXZ4hjXHI=",
|
|
||||||
"owner": "NixOS",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"rev": "dfacb8329b2236688b9a1e705116203a213b283a",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "NixOS",
|
|
||||||
"ref": "master",
|
|
||||||
"repo": "nixpkgs",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": {
|
|
||||||
"inputs": {
|
|
||||||
"flake-utils": "flake-utils",
|
|
||||||
"nixpkgs": "nixpkgs"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"root": "root",
|
|
||||||
"version": 7
|
|
||||||
}
|
|
||||||
30
flake.nix
30
flake.nix
@ -1,30 +0,0 @@
|
|||||||
{
|
|
||||||
inputs = {
|
|
||||||
nixpkgs = {
|
|
||||||
type = "github";
|
|
||||||
owner = "NixOS";
|
|
||||||
repo = "nixpkgs";
|
|
||||||
ref = "master";
|
|
||||||
};
|
|
||||||
flake-utils = {
|
|
||||||
type = "github";
|
|
||||||
owner = "numtide";
|
|
||||||
repo = "flake-utils";
|
|
||||||
ref = "master";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem
|
|
||||||
(system:
|
|
||||||
let pkgs = import nixpkgs {
|
|
||||||
inherit system;
|
|
||||||
config.allowUnfree = true;
|
|
||||||
};
|
|
||||||
in {
|
|
||||||
devShell = pkgs.mkShell {
|
|
||||||
name = "uni2work-serversession";
|
|
||||||
nativeBuildInputs = with pkgs.haskellPackages; [ stack ];
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
import (
|
|
||||||
let
|
|
||||||
lock = builtins.fromJSON (builtins.readFile ./flake.lock);
|
|
||||||
in fetchTarball {
|
|
||||||
url = "https://api.github.com/repos/NixOS/nixpkgs/tarball/${lock.nodes.nixpkgs.locked.rev}";
|
|
||||||
sha256 = lock.nodes.nixpkgs.locked.narHash;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
@ -26,7 +26,7 @@ library
|
|||||||
, acid-state >= 0.16
|
, acid-state >= 0.16
|
||||||
, containers
|
, containers
|
||||||
, mtl
|
, mtl
|
||||||
, safecopy >= 0.8 && <0.11
|
, safecopy >= 0.8
|
||||||
, unordered-containers
|
, unordered-containers
|
||||||
|
|
||||||
, serversession == 1.0.*
|
, serversession == 1.0.*
|
||||||
|
|||||||
@ -112,8 +112,6 @@ instance SafeCopy SS.SessionMap where
|
|||||||
instance Typeable sess => SafeCopy (SS.SessionId sess) where
|
instance Typeable sess => SafeCopy (SS.SessionId sess) where
|
||||||
putCopy = contain . safePut . SSI.unS
|
putCopy = contain . safePut . SSI.unS
|
||||||
getCopy = contain $ SSI.S <$> safeGet
|
getCopy = contain $ SSI.S <$> safeGet
|
||||||
|
|
||||||
errorTypeName _ = "SessionId"
|
|
||||||
|
|
||||||
|
|
||||||
-- | We can't @deriveSafeCopy 0 'base ''SS.Session@ due to the
|
-- | We can't @deriveSafeCopy 0 'base ''SS.Session@ due to the
|
||||||
@ -134,8 +132,6 @@ instance (Typeable sess, SafeCopy (SS.Decomposed sess)) => SafeCopy (SS.Session
|
|||||||
<*> safeGet
|
<*> safeGet
|
||||||
<*> get_t
|
<*> get_t
|
||||||
<*> get_t
|
<*> get_t
|
||||||
|
|
||||||
errorTypeName _ = "Session"
|
|
||||||
|
|
||||||
|
|
||||||
-- | We can't @deriveSafeCopy 0 'base ''ServerSessionAcidState@ due
|
-- | We can't @deriveSafeCopy 0 'base ''ServerSessionAcidState@ due
|
||||||
@ -148,8 +144,6 @@ instance (Typeable sess, SafeCopy (SS.Decomposed sess)) => SafeCopy (ServerSessi
|
|||||||
ServerSessionAcidState
|
ServerSessionAcidState
|
||||||
<$> (HM.fromList <$> safeGet)
|
<$> (HM.fromList <$> safeGet)
|
||||||
<*> (HM.fromList <$> safeGet)
|
<*> (HM.fromList <$> safeGet)
|
||||||
|
|
||||||
errorTypeName _ = "ServerSessionAcidState"
|
|
||||||
|
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
@ -286,14 +280,10 @@ instance Typeable sess => SafeCopy (GetSession sess) where
|
|||||||
instance Typeable sess => SafeCopy (DeleteSession sess) where
|
instance Typeable sess => SafeCopy (DeleteSession sess) where
|
||||||
putCopy (DeleteSession v) = contain $ safePut v
|
putCopy (DeleteSession v) = contain $ safePut v
|
||||||
getCopy = contain $ DeleteSession <$> safeGet
|
getCopy = contain $ DeleteSession <$> safeGet
|
||||||
|
|
||||||
errorTypeName _ = "DeleteSession"
|
|
||||||
|
|
||||||
instance Typeable sess => SafeCopy (DeleteAllSessionsOfAuthId sess) where
|
instance Typeable sess => SafeCopy (DeleteAllSessionsOfAuthId sess) where
|
||||||
putCopy (DeleteAllSessionsOfAuthId v) = contain $ safePut v
|
putCopy (DeleteAllSessionsOfAuthId v) = contain $ safePut v
|
||||||
getCopy = contain $ DeleteAllSessionsOfAuthId <$> safeGet
|
getCopy = contain $ DeleteAllSessionsOfAuthId <$> safeGet
|
||||||
|
|
||||||
errorTypeName _ = "DeleteAllSessionsOfAuthId"
|
|
||||||
|
|
||||||
instance (Typeable sess, SafeCopy (SS.Decomposed sess)) => SafeCopy (InsertSession sess) where
|
instance (Typeable sess, SafeCopy (SS.Decomposed sess)) => SafeCopy (InsertSession sess) where
|
||||||
putCopy (InsertSession v) = contain $ safePut v
|
putCopy (InsertSession v) = contain $ safePut v
|
||||||
@ -303,8 +293,6 @@ instance (Typeable sess, SafeCopy (SS.Decomposed sess)) => SafeCopy (ReplaceSess
|
|||||||
putCopy (ReplaceSession v) = contain $ safePut v
|
putCopy (ReplaceSession v) = contain $ safePut v
|
||||||
getCopy = contain $ ReplaceSession <$> safeGet
|
getCopy = contain $ ReplaceSession <$> safeGet
|
||||||
|
|
||||||
errorTypeName _ = "ReplaceSession"
|
|
||||||
|
|
||||||
type AcidContext sess =
|
type AcidContext sess =
|
||||||
( SS.IsSessionData sess
|
( SS.IsSessionData sess
|
||||||
, SafeCopy sess
|
, SafeCopy sess
|
||||||
@ -333,10 +321,9 @@ instance AcidContext sess => Method (ReplaceSession sess) where
|
|||||||
type MethodState (ReplaceSession sess) = ServerSessionAcidState sess
|
type MethodState (ReplaceSession sess) = ServerSessionAcidState sess
|
||||||
|
|
||||||
instance AcidContext sess => IsAcidic (ServerSessionAcidState sess) where
|
instance AcidContext sess => IsAcidic (ServerSessionAcidState sess) where
|
||||||
acidEvents =
|
acidEvents =
|
||||||
[ flip QueryEvent safeCopyMethodSerialiser $ \(GetSession sid) -> getSession sid
|
[ QueryEvent (\(GetSession sid) -> getSession sid) safeCopyMethodSerialiser
|
||||||
, flip UpdateEvent safeCopyMethodSerialiser $ \(DeleteSession sid) -> deleteSession sid
|
, UpdateEvent (\(DeleteSession sid) -> deleteSession sid) safeCopyMethodSerialiser
|
||||||
, flip UpdateEvent safeCopyMethodSerialiser $ \(DeleteAllSessionsOfAuthId authId) -> deleteAllSessionsOfAuthId authId
|
, UpdateEvent (\(DeleteAllSessionsOfAuthId authId) -> deleteAllSessionsOfAuthId authId) safeCopyMethodSerialiser
|
||||||
, flip UpdateEvent safeCopyMethodSerialiser $ \(InsertSession session) -> insertSession session
|
, UpdateEvent (\(InsertSession session) -> insertSession session) safeCopyMethodSerialiser
|
||||||
, flip UpdateEvent safeCopyMethodSerialiser $ \(ReplaceSession session) -> replaceSession session
|
, UpdateEvent (\(ReplaceSession session) -> replaceSession session) safeCopyMethodSerialiser ]
|
||||||
]
|
|
||||||
|
|||||||
16
stack.nix
16
stack.nix
@ -1,16 +0,0 @@
|
|||||||
{ ghc, nixpkgs ? import ./nixpkgs.nix }:
|
|
||||||
|
|
||||||
let
|
|
||||||
# haskellPackages = import ./stackage.nix { inherit nixpkgs; };
|
|
||||||
haskellPackages = pkgs.haskellPackages;
|
|
||||||
inherit (nixpkgs {}) pkgs;
|
|
||||||
in pkgs.haskell.lib.buildStackProject {
|
|
||||||
inherit ghc;
|
|
||||||
inherit (haskellPackages) stack;
|
|
||||||
name = "stackenv";
|
|
||||||
buildInputs = (with pkgs;
|
|
||||||
[ # postgresql zlib libsodium gmp llvm_9
|
|
||||||
]) ++ (with haskellPackages;
|
|
||||||
[ # yesod-bin happy alex
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
@ -29,9 +29,4 @@ extra-deps:
|
|||||||
- map-syntax-0.3@sha256:ca8b449615fa57419c16a5e98844624a6ac758692b87b3cfae8c74c87c56f1b2,2420
|
- map-syntax-0.3@sha256:ca8b449615fa57419c16a5e98844624a6ac758692b87b3cfae8c74c87c56f1b2,2420
|
||||||
- pwstore-fast-2.4.4@sha256:9b6a37510d8b9f37f409a8ab3babac9181afcaaa3fce8ba1c131a7ed3de30698,1351
|
- pwstore-fast-2.4.4@sha256:9b6a37510d8b9f37f409a8ab3babac9181afcaaa3fce8ba1c131a7ed3de30698,1351
|
||||||
- xmlhtml-0.2.5.2@sha256:3f0990f725551985d777e8edb5563fe99aee998f1fde6a7633f720f76df54701,46997
|
- xmlhtml-0.2.5.2@sha256:3f0990f725551985d777e8edb5563fe99aee998f1fde6a7633f720f76df54701,46997
|
||||||
resolver: lts-16.31
|
resolver: lts-15.8
|
||||||
nix:
|
|
||||||
packages: []
|
|
||||||
pure: false
|
|
||||||
shell-file: ./stack.nix
|
|
||||||
add-gc-roots: true
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@ packages:
|
|||||||
hackage: xmlhtml-0.2.5.2@sha256:3f0990f725551985d777e8edb5563fe99aee998f1fde6a7633f720f76df54701,46997
|
hackage: xmlhtml-0.2.5.2@sha256:3f0990f725551985d777e8edb5563fe99aee998f1fde6a7633f720f76df54701,46997
|
||||||
snapshots:
|
snapshots:
|
||||||
- completed:
|
- completed:
|
||||||
size: 534126
|
size: 492015
|
||||||
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/16/31.yaml
|
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/15/8.yaml
|
||||||
sha256: 637fb77049b25560622a224845b7acfe81a09fdb6a96a3c75997a10b651667f6
|
sha256: 926bc3d70249dd0ba05277ff00943c0addb35b627cb641752669e7cf771310d0
|
||||||
original: lts-16.31
|
original: lts-15.8
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user