aboutsummaryrefslogtreecommitdiff
path: root/site/pastebin/nix-exps.org
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2018-07-15 21:11:57 -0300
committerEuAndreh <eu@euandre.org>2018-07-15 21:12:32 -0300
commite87dbf00de5c638120e2b7bcb15b0ba8b06a2b2e (patch)
treef08e59022bb9c863ca8d7eb84d10c3e9c47f8b65 /site/pastebin/nix-exps.org
parentAdd extra slide reference (diff)
downloadeuandre.org-e87dbf00de5c638120e2b7bcb15b0ba8b06a2b2e.tar.gz
euandre.org-e87dbf00de5c638120e2b7bcb15b0ba8b06a2b2e.tar.xz
Add initial Hakyll website skeleton
Diffstat (limited to 'site/pastebin/nix-exps.org')
-rw-r--r--site/pastebin/nix-exps.org44
1 files changed, 44 insertions, 0 deletions
diff --git a/site/pastebin/nix-exps.org b/site/pastebin/nix-exps.org
new file mode 100644
index 0000000..ac06826
--- /dev/null
+++ b/site/pastebin/nix-exps.org
@@ -0,0 +1,44 @@
+#+SETUPFILE: ../../pastebin-template.org
+#+TITLE: Nix Stuff
+#+BEGIN_SRC nix -n
+let
+ pkgsOriginal = import <nixpkgs> {};
+ pkgsSrc = pkgsOriginal.fetchzip {
+ url = "https://github.com/NixOS/nixpkgs/archive/18.03.zip";
+ sha256 = "0hk4y2vkgm1qadpsm4b0q1vxq889jhxzjx3ragybrlwwg54mzp4f";
+ };
+ pkgs = import (pkgsSrc) {};
+ stdenv = pkgs.stdenv;
+
+ # Taken from:
+ # http://www.cs.yale.edu/homes/lucas.paul/posts/2017-04-10-hakyll-on-nix.html
+ websiteBuilder = pkgs.stdenv.mkDerivation {
+ name = "website-builder";
+ src = ./hakyll;
+ phases = "unpackPhase buildPhase";
+ buildInputs = [
+ (pkgs.haskellPackages.ghcWithPackages (p: with p; [ hakyll ]))
+ ];
+ buildPhase = ''
+ mkdir -p $out/bin
+ ghc -O2 -dynamic --make Main.hs -o $out/bin/generate-site
+ '';
+ };
+in rec {
+ euandrehWebsite = stdenv.mkDerivation rec {
+ name = "euandreh-website";
+ src = ./site;
+ phases = "unpackPhase buildPhase";
+ # version = "0.1";
+ buildInputs = [ websiteBuilder ];
+ buildPhase = ''
+ export LOCALE_ARCHIVE="${pkgs.glibcLocales}/lib/locale/locale-archive";
+ export LANG=en_US.UTF-8
+ generate-site build
+
+ mkdir $out
+ cp -r _site/* $out
+ '';
+ };
+}
+#+END_SRC