From 020c1e77489b772f854bb3288b9c8d2818a6bf9d Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 18 Apr 2025 02:17:12 -0300 Subject: git mv src/content/* src/content/en/ --- src/content/en/pastebins/2018/07/25/nix-exps.adoc | 46 +++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/content/en/pastebins/2018/07/25/nix-exps.adoc (limited to 'src/content/en/pastebins/2018/07/25/nix-exps.adoc') diff --git a/src/content/en/pastebins/2018/07/25/nix-exps.adoc b/src/content/en/pastebins/2018/07/25/nix-exps.adoc new file mode 100644 index 0000000..04cb7f4 --- /dev/null +++ b/src/content/en/pastebins/2018/07/25/nix-exps.adoc @@ -0,0 +1,46 @@ += Nix exps +:categories: nix + +[source,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