summaryrefslogtreecommitdiff
path: root/hakyll-nix/shell.nix
diff options
context:
space:
mode:
authorstuebinm2021-05-28 18:38:51 +0200
committerstuebinm2021-05-28 18:38:51 +0200
commit818f7a68df4ca0221107b2d07eb502b16fa6d653 (patch)
treee8939bed4a329fc37dc06e466ea53e4c7d4626c5 /hakyll-nix/shell.nix
parent855acf6b984855646119551b39bffb4cf169dc40 (diff)
hakyll wrapped in a nix derivation
(see the Readme.org file for more information)
Diffstat (limited to '')
-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