Switch to more modern cabal2nix-based workflow.

[?]
Jan 16, 2015, 9:11 PM
2Y2QZFVFSKXEFEGYJB5A7GI735ONWPCF7DVTIY5T73AUEVTZTBBQC

Dependencies

  • [2] HE3JTXO3 Added client call to payouts.
  • [3] AXKKXBWN Initial attempt at writing down my ideas for a company based on trust.
  • [4] T44T2PDL Rename trust.txt to README.md
  • [5] 64C6AWH6 Rename Ananke -> Quixotic, project reboot.
  • [6] EQXRXRZD Changed to use tasty instead of test-framework
  • [7] 64VI73NP Server now compiles using abstracted SQLite
  • [8] Z3M53KTL Adrift.
  • [9] WZUHEZSB Start of migration back toward snap.
  • [10] 45AI46JN Move readme to inception.md
  • [11] ADMKQQGC Initial empty Snap project.
  • [12] 5W5M56VJ Move library code to 'lib'
  • [13] RSEB2NFG Replacing Snap with Scotty.
  • [14] NTPC7KJE Trivial changes, feature scratchpad.
  • [15] NVOCQVAS Initial failing tests.
  • [16] LAROLAYU WIP
  • [17] 4IQVQL4T Added client for payouts endpoint.
  • [18] OBFPJS2G Project successfully builds and tests under nix.
  • [19] QO4NFWIY Added sample config file.
  • [20] TCOAKCGG Completed conversion to snap.

Change contents

  • file deletion: default.nix (----------)
    [3.2][3.1445:1480](),[3.1480][3.418:418]()
    # This file was auto-generated by cabal2nix. Please do NOT edit manually!
    { haskellPackages ? (import <nixpkgs> {}).haskellPackages }:
    #{ cabal, aeson, bifunctors, classyPrelude
    #, configurator, either, errors, groups, hourglass, hspec, lens
    #, MonadCatchIOTransformers, mtl, networkBitcoin
    #, optparseApplicative, safe, snapCore, snapServer, sqliteSimple
    #, text, time, transformers
    #}:
    with haskellPackages; cabal.mkDerivation (self: {
    pname = "quixotic";
    version = "0.1";
    src = "./.";
    isLibrary = true;
    isExecutable = true;
    #buildTools = [ cabalInstall ];
    buildDepends = [
    aeson bifunctors classyPrelude configurator either
    errors groups hourglass lens MonadCatchIOTransformers mtl
    networkBitcoin optparseApplicative safe snapCore snapServer
    sqliteSimple text time transformers
    ];
    testDepends = [ aeson hspec text time ];
    meta = {
    description = "The Quixotic Collaboration Platform";
    license = self.stdenv.lib.licenses.unfree;
    platforms = self.ghc.meta.platforms;
    };
    })
  • replacement in lib/Quixotic/Client.hs at line 16
    [3.243][3.243:294]()
    { quixoticHost :: String
    , quixoticPort :: Int
    [3.243]
    [2.91]
    { quixoticUrl :: String
  • replacement in lib/Quixotic/Client.hs at line 21
    [2.173][2.173:262]()
    QCConfig <$> C.require cfg "quixoticHost"
    <*> C.require cfg "quixoticPort"
    [2.173]
    [3.298]
    QCConfig <$> C.require cfg "quixoticUrl"
  • replacement in lib/Quixotic/Client.hs at line 25
    [3.364][3.364:411]()
    resp <- get (quixoticHost cfg <> "/payouts")
    [3.364]
    [3.411]
    resp <- get (quixoticUrl cfg <> "payouts")
  • edit in server/Main.hs at line 11
    [3.152]
    [3.226]
    import qualified Data.Configurator.Types as CT
  • edit in server/Main.hs at line 22
    [3.1633]
    [3.5492]
    import qualified Snap.Http.Server.Config as SC
  • replacement in server/Main.hs at line 26
    [3.1644][3.153:189](),[3.229][3.153:189]()
    cfg <- parseConfig "quixotic.cfg"
    [3.1644]
    [3.257]
    cfg <- loadQConfig "quixotic.cfg"
  • replacement in server/Main.hs at line 28
    [3.284][3.284:334]()
    quickHttpServe $ runReaderT (site sqliteQDB) db
    [3.284]
    [3.2594]
    sconf <- snapConfig cfg
    simpleHttpServe sconf $ runReaderT (site sqliteQDB) db
  • replacement in server/Main.hs at line 39
    [3.1955][3.272:288](),[3.272][3.272:288]()
    { port :: Int
    [3.1955]
    [3.288]
    { hostname :: ByteString
    , port :: Int
    , sslCert :: FilePath
    , sslKey :: FilePath
  • replacement in server/Main.hs at line 46
    [3.315][3.315:379]()
    parseConfig :: FilePath -> IO QConfig
    parseConfig cfgFile = do
    [3.315]
    [3.505]
    loadQConfig :: FilePath -> IO QConfig
    loadQConfig cfgFile = do
  • replacement in server/Main.hs at line 49
    [3.555][3.416:475](),[3.416][3.416:475]()
    QConfig <$> C.require cfg "port" <*> C.require cfg "db"
    [3.555]
    [3.5695]
    parseQConfig cfg
    parseQConfig :: CT.Config -> IO QConfig
    parseQConfig cfg =
    QConfig <$> C.lookupDefault "localhost" cfg "hostname"
    <*> C.lookupDefault 8443 cfg "port"
    <*> (fmap fpFromText $ C.require cfg "sslCert")
    <*> (fmap fpFromText $ C.require cfg "sslKey")
    <*> C.require cfg "db"
    baseSnapConfig :: MonadSnap m => QConfig -> SC.Config m a -> SC.Config m a
    baseSnapConfig cfg =
    SC.setHostname (hostname cfg) .
    SC.setSSLPort (port cfg) .
    SC.setSSLCert (fpToString $ sslCert cfg) .
    SC.setSSLKey (fpToString $ sslKey cfg)
    snapConfig :: QConfig -> IO (SC.Config Snap ())
    snapConfig cfg = SC.commandLineConfig $ baseSnapConfig cfg emptyConfig