aboutsummaryrefslogtreecommitdiff
path: root/content/_pastebins/nix-exps.md
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-02-05 02:27:38 -0300
committerEuAndreh <eu@euandre.org>2020-02-05 02:27:38 -0300
commita444f722e2a3fd5c019b750c1809222e6328cc67 (patch)
tree626e845849daef404c32e30b914d2dc2f3bcc3b6 /content/_pastebins/nix-exps.md
parentUse collections for pastebins (diff)
downloadeuandre.org-a444f722e2a3fd5c019b750c1809222e6328cc67.tar.gz
euandre.org-a444f722e2a3fd5c019b750c1809222e6328cc67.tar.xz
Use collections_dir
Diffstat (limited to 'content/_pastebins/nix-exps.md')
-rw-r--r--content/_pastebins/nix-exps.md48
1 files changed, 48 insertions, 0 deletions
diff --git a/content/_pastebins/nix-exps.md b/content/_pastebins/nix-exps.md
new file mode 100644
index 0000000..d2ad658
--- /dev/null
+++ b/content/_pastebins/nix-exps.md
@@ -0,0 +1,48 @@
+---
+title: Nix Stuff
+date: 2018-07-25
+layout: pastebin
+---
+
+``` {.nix .numberLines startFrom=""}
+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
+ '';
+ };
+}
+```