Last active
September 29, 2019 03:37
-
-
Save rizary/db7af8393fb546bdd4e294fd6b03ee32 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| newPkgs: oldPkgs: | |
| with oldPkgs; | |
| let | |
| noCheck = p: haskell.lib.dontCheck p; | |
| noHaddock = p: haskell.lib.dontHaddock p; | |
| fast = p: noHaddock (noCheck p); | |
| static = p: haskell.lib.justStaticExecutables (fast p); | |
| in { | |
| # All haskellPackages | |
| haskellPackages = oldPkgs.callPackage ./backend {}; | |
| # Backend Webapp | |
| hnapp-backend = newPkgs.haskellPackages.backend-server; | |
| hnapp-backend-static = static newPkgs.haskellPackages.backend-server; | |
| # Frontend Webapp | |
| event-store = oldPkgs.callPackage ./eventstore.nix | |
| { pullImage = dockerTools.pullImage; }; | |
| # Docker for backend-server | |
| docker-exe-static = newPkgs.callPackage ./backend/docker.nix { static = true; }; | |
| docker-exe = newPkgs.callPackage ./backend/docker.nix { static = false; }; | |
| # Tools | |
| ghcide = let url = "https://github.com/hercules-ci/ghcide-nix/tarball/master"; | |
| in (import (builtins.fetchTarball url) {})."ghcide-ghc865"; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { mkDerivation, aeson, base-noprelude, byline, bytestring | |
| , containers, eventstore, either, lens, mtl, pipes, postgresql-simple, relude, servant | |
| , servant-client, servant-pipes, servant-snap, snap, stdenv | |
| , streaming, streamly, text | |
| }: | |
| mkDerivation { | |
| pname = "backend"; | |
| version = "0.1.0.0"; | |
| src = ../../backend; | |
| isLibrary = true; | |
| isExecutable = true; | |
| libraryHaskellDepends = [ | |
| aeson base-noprelude byline bytestring containers lens mtl pipes | |
| eventstore either relude servant servant-client servant-pipes | |
| servant-snap snap streaming streamly text | |
| ]; | |
| homepage = "https://www.github.com/rizary/hnapp"; | |
| license = stdenv.lib.licenses.agpl3; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { haskell, lib }: | |
| # build new overlay with own packages | |
| # using extend instead of override. | |
| # drawback: see nixpkgs#26561 | |
| haskell.packages.ghc865.override (old: { | |
| overrides = lib.composeExtensions (old.overrides or (_: _: {})) (newHaskellPkgs: oldHaskellPkgs: { | |
| # When using callHackage, remember to check the all-cabal-hashes used by nixpkgs. | |
| # we can override it to the latest all-cabal-hashes. | |
| # version of package must be recognize on hackage. | |
| # ------------------- common | |
| base-noprelude = newHaskellPkgs.callHackage "base-noprelude" "4.12.0.0" {}; | |
| relude = newHaskellPkgs.callHackage "relude" "0.5.0" {}; | |
| # ------------------- library | |
| aeson = newHaskellPkgs.callHackage "aeson" "1.4.4.0" {}; | |
| byline = newHaskellPkgs.callHackage "byline" "0.3.2.0" {}; | |
| bytestring = newHaskellPkgs.callHackage "bytestring" "0.10.10.0" {}; | |
| containers = newHaskellPkgs.callHackage "containers" "0.6.2.1" {}; | |
| either = newHaskellPkgs.callHackage "either" "5.0.1.1" {}; | |
| eventstore = newHaskellPkgs.callHackage "eventstore" "1.3.0" {}; | |
| lens = newHaskellPkgs.callHackage "lens" "4.17" {}; | |
| mtl = newHaskellPkgs.callHackage "mtl" "2.2.2" {}; | |
| pipes = newHaskellPkgs.callHackage "pipes" "4.3.12" {}; | |
| servant = newHaskellPkgs.callHackage "servant" "0.16" {}; | |
| servant-client = newHaskellPkgs.callHackage "servant-client" "0.16" {}; | |
| servant-pipes = newHaskellPkgs.callHackage "servant-pipes" "0.15" {}; | |
| servant-snap = newHaskellPkgs.callHackage "servant-snap" "0.8.4" {}; | |
| snap = newHaskellPkgs.callHackage "snap" "1.1.2.0" {}; | |
| streaming = newHaskellPkgs.callHackage "streaming" "0.2.2.0" {}; | |
| streamly = newHaskellPkgs.callHackage "streamly" "0.6.1" {}; | |
| text = newHaskellPkgs.callHackage "text" "1.2.4.0" {}; | |
| backend-server = | |
| newHaskellPkgs.callPackage ./backend.nix {}; | |
| }); | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Entry point | |
| */ | |
| {nixpkgsSrc ? ./nixdeps/nixpkgs.nix}: | |
| import (import ./nixdeps/nixpkgs.nix) { | |
| config = { | |
| allowBroken = true; | |
| }; | |
| overlays = [ | |
| (import ./all-packages.nix) | |
| ]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let | |
| pkgs = import ./nix {}; | |
| in | |
| with pkgs; | |
| mkShell { | |
| inputsFrom = [ | |
| #hnapp-backend | |
| eventstore | |
| ]; | |
| nativeBuildInputs = [ | |
| git | |
| ]; | |
| buildInputs = [ | |
| haskellPackages.ghc | |
| ghcide | |
| ]; | |
| LC_ALL = "en_US.UTF-8"; | |
| shellHook = '' | |
| export NIX_GHC="${haskellPackages.ghc}/bin/ghc" | |
| export NIX_GHCPKG="${haskellPackages.ghc}/bin/ghc-pkg" | |
| export NIX_GHC_DOCDIR="${haskellPackages.ghc}/share/doc/ghc/html" | |
| export NIX_GHC_LIBDIR=$( $NIX_GHC --print-libdir ) | |
| ''; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment