summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Foundation.hs8
-rw-r--r--bar.cabal18
-rw-r--r--bar.nix1
-rw-r--r--default.nix39
-rw-r--r--shell.nix8
-rw-r--r--stack.yaml2
6 files changed, 45 insertions, 31 deletions
diff --git a/Foundation.hs b/Foundation.hs
index 444547b..22e5d49 100644
--- a/Foundation.hs
+++ b/Foundation.hs
@@ -108,10 +108,10 @@ instance Yesod App where
108 108
109 -- What messages should be logged. The following includes all messages when 109 -- What messages should be logged. The following includes all messages when
110 -- in development, and warnings and errors in production. 110 -- in development, and warnings and errors in production.
111 shouldLog app _source level = 111 shouldLogIO app _source level = return $ or
112 appShouldLogAll (appSettings app) 112 [ appShouldLogAll (appSettings app)
113 || level == LevelWarn 113 , level >= LevelWarn
114 || level == LevelError 114 ]
115 115
116 makeLogger = return . appLogger 116 makeLogger = return . appLogger
117 117
diff --git a/bar.cabal b/bar.cabal
index 94dfacc..94b5409 100644
--- a/bar.cabal
+++ b/bar.cabal
@@ -67,11 +67,11 @@ library
67 base >= 4.8.2.0 && < 4.9 67 base >= 4.8.2.0 && < 4.9
68 || >= 4.9.1.0 && < 5 68 || >= 4.9.1.0 && < 5
69 69
70 , yesod >= 1.4.3 && < 1.5 70 , yesod >= 1.6.0 && < 1.7
71 , yesod-core >= 1.4.30 && < 1.5 71 , yesod-core >= 1.6.2 && < 1.7
72 , yesod-auth >= 1.4.0 && < 1.5 72 , yesod-auth >= 1.6.2 && < 1.7
73 , yesod-static >= 1.4.0.3 && < 1.6 73 , yesod-static >= 1.6.0 && < 1.7
74 , yesod-form >= 1.4.0 && < 1.5 74 , yesod-form >= 1.6.1 && < 1.7
75 , classy-prelude >= 0.10.2 75 , classy-prelude >= 0.10.2
76 , classy-prelude-conduit >= 0.10.2 76 , classy-prelude-conduit >= 0.10.2
77 -- version 1.0 had a bug in reexporting Handler, causing trouble 77 -- version 1.0 had a bug in reexporting Handler, causing trouble
@@ -79,8 +79,8 @@ library
79 || >= 1.1 79 || >= 1.1
80 , bytestring >= 0.9 && < 0.11 80 , bytestring >= 0.9 && < 0.11
81 , text >= 0.11 && < 2.0 81 , text >= 0.11 && < 2.0
82 , persistent >= 2.0 && < 2.7 82 , persistent >= 2.8.1 && < 2.9
83 , persistent-postgresql >= 2.1.1 && < 2.7 83 , persistent-postgresql >= 2.8.2 && < 2.9
84 , persistent-template >= 2.0 && < 2.7 84 , persistent-template >= 2.0 && < 2.7
85 , template-haskell 85 , template-haskell
86 , shakespeare >= 2.0 && < 2.1 86 , shakespeare >= 2.0 && < 2.1
@@ -88,11 +88,11 @@ library
88 , monad-control >= 0.3 && < 1.1 88 , monad-control >= 0.3 && < 1.1
89 , wai-extra >= 3.0 && < 3.1 89 , wai-extra >= 3.0 && < 3.1
90 , yaml >= 0.8 && < 0.9 90 , yaml >= 0.8 && < 0.9
91 , http-conduit >= 2.1 && < 2.3 91 , http-conduit >= 2.3.0 && < 2.4
92 , directory >= 1.1 && < 1.4 92 , directory >= 1.1 && < 1.4
93 , warp >= 3.0 && < 3.3 93 , warp >= 3.0 && < 3.3
94 , data-default 94 , data-default
95 , aeson >= 0.6 && < 1.1 95 , aeson >= 1.2.4 && < 1.3
96 , conduit >= 1.0 && < 2.0 96 , conduit >= 1.0 && < 2.0
97 , monad-logger >= 0.3 && < 0.4 97 , monad-logger >= 0.3 && < 0.4
98 , fast-logger >= 2.2 && < 2.5 98 , fast-logger >= 2.2 && < 2.5
diff --git a/bar.nix b/bar.nix
index 6121182..9849765 100644
--- a/bar.nix
+++ b/bar.nix
@@ -27,4 +27,5 @@ mkDerivation {
27 executableHaskellDepends = [ base ]; 27 executableHaskellDepends = [ base ];
28 doHaddock = false; 28 doHaddock = false;
29 license = stdenv.lib.licenses.unfree; 29 license = stdenv.lib.licenses.unfree;
30 hydraPlatforms = stdenv.lib.platforms.none;
30} 31}
diff --git a/default.nix b/default.nix
index 1e631cf..dc8c226 100644
--- a/default.nix
+++ b/default.nix
@@ -1,14 +1,13 @@
1argumentPackages@{ ... }: 1argumentPackages@{ ... }:
2 2
3let 3let
4 defaultPackages = (import <nixpkgs> {}).haskellPackages;
5 haskellPackages = defaultPackages // argumentPackages;
6 pkgs = (import <nixpkgs> {}).pkgs // argumentPackages; 4 pkgs = (import <nixpkgs> {}).pkgs // argumentPackages;
7 5 haskellPackages = pkgs.haskellPackages // argumentPackages;
8 webshim = with pkgs; stdenv.mkDerivation rec { 6 pkg = haskellPackages.callPackage ./bar.nix {};
7 webshim = pkgs.stdenv.mkDerivation rec {
9 name = "webshim-${version}"; 8 name = "webshim-${version}";
10 version = "1.16.0"; 9 version = "1.16.0";
11 src = fetchFromGitHub { 10 src = pkgs.fetchFromGitHub {
12 owner = "aFarkas"; 11 owner = "aFarkas";
13 repo = "webshim"; 12 repo = "webshim";
14 rev = "1.16.0"; 13 rev = "1.16.0";
@@ -20,10 +19,24 @@ let
20 cp -r $src/js-webshim/dev/* $out/js/ 19 cp -r $src/js-webshim/dev/* $out/js/
21 ''; 20 '';
22 }; 21 };
23in pkgs.stdenv.lib.overrideDerivation (haskellPackages.callPackage ./bar.nix {}) (oldAttrs: { 22 jquery = pkgs.stdenv.mkDerivation rec {
24 postUnpack = '' 23 name = "jquery-${version}";
25 rm -rf bar/static/jquery.js bar/static/webshim 24 version = "3.3.1";
26 ln -vs ${pkgs.jquery}/js/jquery.js bar/static 25 src = pkgs.fetchurl {
27 ln -vs ${webshim}/js bar/static/webshim 26 url = "https://github.com/jquery/jquery/archive/${version}.tar.gz";
27 sha256 = "1d1pilrwiz0yjx27cd7gbn8qar6hw5zgwjhpsyaijcg52z82wi5q";
28 };
29
30 installPhase = ''
31 mkdir -p $out/js
32 cp -r dist/jquery.js $out/js/
28 ''; 33 '';
34 };
35in pkgs.stdenv.lib.overrideDerivation pkg (drv: {
36 postUnpack = ''
37 cd bar-*/static
38 rm -rf jquery.js webshim
39 ln -vs ${jquery}/js/jquery.js .
40 ln -vs ${webshim}/js webshim
41 '';
29}) 42})
diff --git a/shell.nix b/shell.nix
index b2b6842..eb6bd17 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,13 +1,13 @@
1{ nixpkgs ? import <nixpkgs> {}, compiler ? "default" }: 1{ nixpkgs ? import <nixpkgs> {}, compiler ? null }:
2 2
3let 3let
4 inherit (nixpkgs) pkgs; 4 inherit (nixpkgs) pkgs;
5 5
6 haskellPackages = if compiler == "default" 6 haskellPackages = if compiler == null
7 then pkgs.haskellPackages 7 then pkgs.haskellPackages
8 else pkgs.haskell.packages.${compiler}; 8 else pkgs.haskell.packages."${compiler}";
9 9
10 drv = haskellPackages.callPackage ./bar.nix {}; 10 drv = import ./default.nix {};
11in 11in
12 pkgs.stdenv.lib.overrideDerivation drv.env (oldAttrs: { 12 pkgs.stdenv.lib.overrideDerivation drv.env (oldAttrs: {
13 nativeBuildInputs = oldAttrs.nativeBuildInputs ++ (with pkgs; [ cabal2nix gup postgresql ]) ++ (with haskellPackages; [ hlint stack yesod-bin alex ]); 13 nativeBuildInputs = oldAttrs.nativeBuildInputs ++ (with pkgs; [ cabal2nix gup postgresql ]) ++ (with haskellPackages; [ hlint stack yesod-bin alex ]);
diff --git a/stack.yaml b/stack.yaml
index eeed1bc..dcf0bec 100644
--- a/stack.yaml
+++ b/stack.yaml
@@ -15,7 +15,7 @@
15# resolver: 15# resolver:
16# name: custom-snapshot 16# name: custom-snapshot
17# location: "./custom-snapshot.yaml" 17# location: "./custom-snapshot.yaml"
18resolver: ghc-8.0.2 18resolver: ghc-8.2.2
19 19
20# User packages to be built. 20# User packages to be built.
21# Various formats can be used as shown in the example below. 21# Various formats can be used as shown in the example below.