diff options
author | EuAndreh <eu@euandre.org> | 2020-02-06 03:58:52 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-02-06 03:58:52 -0300 |
commit | ccadc0bdf0436cefe76318567d358f27a46bf3e5 (patch) | |
tree | 58d52309b1ea2b6b7c3a08feed04deb5d64b83d2 /_pastebins/nix-exps.md | |
parent | Add code metadata annotation (diff) | |
parent | Setup publish environment variables (diff) | |
download | euandre.org-ccadc0bdf0436cefe76318567d358f27a46bf3e5.tar.gz euandre.org-ccadc0bdf0436cefe76318567d358f27a46bf3e5.tar.xz |
Merge branch 'jekyll'
Diffstat (limited to '_pastebins/nix-exps.md')
-rw-r--r-- | _pastebins/nix-exps.md | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/_pastebins/nix-exps.md b/_pastebins/nix-exps.md new file mode 100644 index 0000000..d0ee26b --- /dev/null +++ b/_pastebins/nix-exps.md @@ -0,0 +1,49 @@ +--- +title: Nix Stuff +date: 2018-07-25 +layout: pastebin +lang: en +--- + +```nix +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 + ''; + }; +} +``` |