summaryrefslogtreecommitdiff
path: root/hakyll-nix/shell.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hakyll-nix/shell.nix')
-rw-r--r--hakyll-nix/shell.nix21
1 files changed, 21 insertions, 0 deletions
diff --git a/hakyll-nix/shell.nix b/hakyll-nix/shell.nix
new file mode 100644
index 0000000..2f4985b
--- /dev/null
+++ b/hakyll-nix/shell.nix
@@ -0,0 +1,21 @@
+{ nixpkgs ? import <nixpkgs> {}
+, compiler ? "default"
+, hakyllSrc ? ./defaultsite
+, doBenchmark ? false }:
+
+let
+
+ inherit (nixpkgs) pkgs;
+
+ f = import ./default.nix hakyllSrc;
+
+ haskellPackages = if compiler == "default"
+ then pkgs.haskellPackages
+ else pkgs.haskell.packages.${compiler};
+
+ variant = if doBenchmark then pkgs.haskell.lib.doBenchmark else pkgs.lib.id;
+
+ drv = variant (haskellPackages.callPackage f {});
+
+in
+ if pkgs.lib.inNixShell then drv.env else drv