diff options
| author | Xe Iaso <me@christine.website> | 2022-11-25 19:01:10 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-25 19:01:10 -0500 |
| commit | cc933b31fd23bb06e95bf41f848a1c99353d44ae (patch) | |
| tree | af8288dbd4db2ad886d6b326bffb1c9d5b568de3 /flake.nix | |
| parent | 551e0384c923ff3ee98cfddf7e3eb42c6dbb2941 (diff) | |
| download | xesite-cc933b31fd23bb06e95bf41f848a1c99353d44ae.tar.xz xesite-cc933b31fd23bb06e95bf41f848a1c99353d44ae.zip | |
Start version 3 (#573)
* Start version 3
* Change version to 3.0.0 in Cargo.toml
* Add metadata for series
* Change types for signal boosts
* Add start of LaTeX resume generation at Nix time
* Add start of proper author tagging for posts in JSONFeed and ldjson
* Convert templates to use Maud
* Add start of dynamic resume generation from dhall
* Make patrons page embed thumbnails
TODO:
* [ ] Remove the rest of the old templates
* [ ] Bring in Xeact for the share on mastodon button
* [ ] Site update post
Signed-off-by: Xe <me@christine.website>
* fix nix builds
Signed-off-by: Xe Iaso <me@christine.website>
* fix dhall build
Signed-off-by: Xe Iaso <me@christine.website>
* fix non-flakes build
Signed-off-by: Xe Iaso <me@christine.website>
* make new mastodon share button
Signed-off-by: Xe Iaso <me@christine.website>
* remove the rest of the ructe templates that I can remove
Signed-off-by: Xe Iaso <me@christine.website>
* refactor blogposts to its own file
Signed-off-by: Xe Iaso <me@christine.website>
* move resume to be generated by nix
Signed-off-by: Xe Iaso <me@christine.website>
* write article
Signed-off-by: Xe Iaso <me@christine.website>
* blog/site-update-v3: hero image
Signed-off-by: Xe Iaso <me@christine.website>
* add site update series tag to site updates
Signed-off-by: Xe Iaso <me@christine.website>
Signed-off-by: Xe <me@christine.website>
Signed-off-by: Xe Iaso <me@christine.website>
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 79 |
1 files changed, 72 insertions, 7 deletions
@@ -8,7 +8,10 @@ flake = false; }; flake-utils.url = "github:numtide/flake-utils"; - naersk.url = "github:nix-community/naersk"; + naersk = { + url = "github:nix-community/naersk"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, nixpkgs, flake-utils, naersk, ... }: @@ -17,29 +20,83 @@ pkgs = import nixpkgs { inherit system; }; naersk-lib = naersk.lib."${system}"; src = ./.; + + tex = with pkgs; + texlive.combine { inherit (texlive) scheme-medium bitter titlesec; }; in rec { packages = rec { bin = naersk-lib.buildPackage { pname = "xesite-bin"; root = src; - buildInputs = with pkgs; [ pkg-config openssl git ]; + buildInputs = with pkgs; [ + pkg-config + openssl + git + deno + nodePackages.uglify-js + ]; }; config = pkgs.stdenv.mkDerivation { pname = "xesite-config"; inherit (bin) version; inherit src; - buildInputs = with pkgs; [ dhall ]; + buildInputs = with pkgs; [ dhall dhallPackages.Prelude ]; phases = "installPhase"; installPhase = '' - cd $src mkdir -p $out - dhall resolve < $src/config.dhall >> $out/config.dhall + cp -rf ${pkgs.dhallPackages.Prelude}/.cache .cache + chmod -R u+w .cache + export XDG_CACHE_HOME=.cache + export DHALL_PRELUDE=${pkgs.dhallPackages.Prelude}/binary.dhall; + dhall resolve --file $src/config.dhall >> $out/config.dhall ''; }; + resumePDF = pkgs.stdenv.mkDerivation { + pname = "xesite-resume-pdf"; + inherit (bin) version; + inherit src; + buildInputs = with pkgs; [ dhall dhallPackages.Prelude tex pandoc ]; + + phases = "installPhase"; + + installPhase = '' + mkdir -p $out/static/resume + cp -rf ${pkgs.dhallPackages.Prelude}/.cache .cache + chmod -R u+w .cache + export XDG_CACHE_HOME=.cache + export DHALL_PRELUDE=${pkgs.dhallPackages.Prelude}/binary.dhall; + + ln -s $src/dhall/latex/resume.cls + dhall text --file $src/dhall/latex/resume.dhall > resume.tex + + xelatex ./resume.tex + cp resume.pdf $out/static/resume/resume.pdf + ''; + }; + + frontend = pkgs.stdenv.mkDerivation { + pname = "xesite-frontend"; + inherit (bin) version; + src = ./src/frontend; + buildInputs = with pkgs; [ deno nodePackages.uglify-js ]; + + phases = "installPhase"; + + installPhase = '' + mkdir -p $out/static/js + mkdir -p .deno + export HOME=./.deno + + deno bundle --config $src/deno.json $src/mastodon_share_button.tsx ./mastodon_share_button.js + + uglifyjs ./mastodon_share_button.js -c -m > $out/static/js/mastodon_share_button.js + ''; + }; + static = pkgs.stdenv.mkDerivation { pname = "xesite-static"; inherit (bin) version; @@ -72,7 +129,7 @@ default = pkgs.symlinkJoin { name = "xesite-${bin.version}"; - paths = [ config posts static bin ]; + paths = [ config posts static bin frontend resumePDF ]; }; docker = pkgs.dockerTools.buildLayeredImage { @@ -100,9 +157,16 @@ openssl pkg-config - # kubernetes deployment + # dhall dhall dhall-json + dhall-lsp-server + tex + pandoc + + # frontend + deno + nodePackages.uglify-js # dependency manager niv @@ -117,6 +181,7 @@ RUST_LOG = "debug"; RUST_BACKTRACE = "1"; GITHUB_SHA = "devel"; + DHALL_PRELUDE = "${pkgs.dhallPackages.Prelude}"; }; nixosModules.bot = { config, lib, ... }: |
