From d8e400c40c970996599c801974fadb6d49e60fdd Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 10 Oct 2020 14:51:52 -0300 Subject: Enforce all "post" and "pastebin" layouts have dates in filenames --- _pastebins/2018-07-25-nix-exps.md | 49 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 _pastebins/2018-07-25-nix-exps.md (limited to '_pastebins/2018-07-25-nix-exps.md') diff --git a/_pastebins/2018-07-25-nix-exps.md b/_pastebins/2018-07-25-nix-exps.md new file mode 100644 index 0000000..d0ee26b --- /dev/null +++ b/_pastebins/2018-07-25-nix-exps.md @@ -0,0 +1,49 @@ +--- +title: Nix Stuff +date: 2018-07-25 +layout: pastebin +lang: en +--- + +```nix +let + pkgsOriginal = import {}; + 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 + ''; + }; +} +``` -- cgit v1.2.3