diff --git a/users/glittershark/gws.fyi/Makefile b/users/glittershark/gws.fyi/Makefile index d483e05d4..cfe3dd277 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 6cf7c977e..333f56f7b 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 7f11bb949..000000000 --- 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 000000000..2af54253d --- /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 000000000..b37be1004 --- /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 000000000..5a06203a6 --- /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; +}