From e77b2b8f120577125c9ffcfaf2f62bad0955c7fb Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Mon, 15 Jun 2020 22:24:13 -0400 Subject: feat(gws.fyi): Build from org + integrate with readTree Build from org via emacs --batch, and update all the top-level definitions to make things work nicely with readTree. Change-Id: If0ac49c1d264856392e29b9e7b155641d865525b Reviewed-on: https://cl.tvl.fyi/c/depot/+/400 Reviewed-by: glittershark --- users/glittershark/gws.fyi/Makefile | 2 +- users/glittershark/gws.fyi/default.nix | 7 +++-- users/glittershark/gws.fyi/index.html | 31 ------------------- users/glittershark/gws.fyi/index.org | 15 ++++++++++ users/glittershark/gws.fyi/orgExportHTML.nix | 45 ++++++++++++++++++++++++++++ users/glittershark/gws.fyi/site.nix | 9 ++++++ 6 files changed, 75 insertions(+), 34 deletions(-) delete mode 100644 users/glittershark/gws.fyi/index.html create mode 100644 users/glittershark/gws.fyi/index.org create mode 100644 users/glittershark/gws.fyi/orgExportHTML.nix create mode 100644 users/glittershark/gws.fyi/site.nix (limited to 'users') diff --git a/users/glittershark/gws.fyi/Makefile b/users/glittershark/gws.fyi/Makefile index d483e05d49c6..cfe3dd277d2e 100644 --- a/users/glittershark/gws.fyi/Makefile +++ b/users/glittershark/gws.fyi/Makefile @@ -1,7 +1,7 @@ .PHONY: deploy deploy: - @`nix-build --no-out-link` + @$(shell nix-build `git rev-parse --show-toplevel` -A 'users.glittershark."gws.fyi"' --no-out-link) renew: @echo Renewing... diff --git a/users/glittershark/gws.fyi/default.nix b/users/glittershark/gws.fyi/default.nix index 6cf7c977e60b..333f56f7bce7 100644 --- a/users/glittershark/gws.fyi/default.nix +++ b/users/glittershark/gws.fyi/default.nix @@ -1,12 +1,15 @@ -with import {}; +args@{ pkgs, ... }: +with pkgs; let + site = import ./site.nix args; bucket = "s3://gws.fyi"; distributionID = "E2ST43JNBH8C64"; website = runCommand "gws.fyi" { } '' mkdir -p $out - cp ${./index.html} $out/index.html + cp ${site.index} $out/index.html ''; + in writeShellScript "deploy.sh" '' ${awscli}/bin/aws s3 sync ${website}/ ${bucket} ${awscli}/bin/aws cloudfront create-invalidation \ diff --git a/users/glittershark/gws.fyi/index.html b/users/glittershark/gws.fyi/index.html deleted file mode 100644 index 7f11bb94974e..000000000000 --- a/users/glittershark/gws.fyi/index.html +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - griffin smith - - - my name is griffin ward smith (aka grfn, glittershark, gws) and i'm a software - engineer and musician - - - - contact - - - diff --git a/users/glittershark/gws.fyi/index.org b/users/glittershark/gws.fyi/index.org new file mode 100644 index 000000000000..2af54253db98 --- /dev/null +++ b/users/glittershark/gws.fyi/index.org @@ -0,0 +1,15 @@ +my name is griffin ward smith (aka grfn, glittershark, gws) and i'm a software +engineer and musician + +- [[https://github.com/glittershark/][github]] +- music + - https://sacrosanct.bandcamp.com/, a post-rock project with a [[https://bandcamp.com/h34rken][friend of mine]] + - [[https://soundcloud.com/missingggg][my current soundcloud]], releasing instrumental hip-hop under the name missing + +contact + +- [[mailto:web@gws.fyi][web@gws.fyi]] +- [[https://twitter.com/glittershark1][twitter]] +- https://keybase.io/glittershark +- glittershark on freenode +- [[http://keys.gnupg.net/pks/lookup?op=get&search=0x44EF5B5E861C09A7][gpg key: 0F11A989879E8BBBFDC1E23644EF5B5E861C09A7]] diff --git a/users/glittershark/gws.fyi/orgExportHTML.nix b/users/glittershark/gws.fyi/orgExportHTML.nix new file mode 100644 index 000000000000..b37be10045dd --- /dev/null +++ b/users/glittershark/gws.fyi/orgExportHTML.nix @@ -0,0 +1,45 @@ +{ pkgs, ... }: + +with pkgs; +with lib; + +let + + emacs-nixpkgs = + (import { + overlays = [(import (builtins.fetchTarball { + url = "https://github.com/nix-community/emacs-overlay/archive/54afb061bdd12c61bbfcc13bad98b7a3aab7d8d3.tar.gz"; + sha256 = "0hrbg65d5h0cb0nky7a46md7vlvhajq1hf0328l2f7ln9hznqz6j"; + }))]; + }); + + emacs = (emacs-nixpkgs.emacsPackagesFor emacs-nixpkgs.emacsUnstable) + .emacsWithPackages (p: with p; [ + org + ]); + +in + +src: + +let + + outName = + let bn = builtins.baseNameOf src; + filename = elemAt (splitString "." bn) 0; + in filename + ".html"; + +in + +runCommand outName {} '' + cp ${src} file.org + echo "${emacs}/bin/emacs --batch" + ${emacs}/bin/emacs --batch \ + --load ${./config.el} \ + --visit file.org \ + --eval "(progn + (require 'org) + (org-html-export-to-html))" \ + --kill + cp file.html $out +'' diff --git a/users/glittershark/gws.fyi/site.nix b/users/glittershark/gws.fyi/site.nix new file mode 100644 index 000000000000..5a06203a6b1e --- /dev/null +++ b/users/glittershark/gws.fyi/site.nix @@ -0,0 +1,9 @@ +args@{ pkgs, depot, ... }: + +let + orgExportHTML = import ./orgExportHTML.nix args; +in + +{ + index = orgExportHTML ./index.org; +} -- cgit 1.4.1