Migrate to new site with zola

pull/1/head
mat ess 2022-08-08 00:31:56 -04:00
parent 8913f9b57f
commit 05a1ea8741
24 changed files with 504 additions and 37 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
.direnv/
themes/
public/

View File

@ -1,11 +0,0 @@
image: alpine
pages:
script:
- mkdir public
- cp site/* public
artifacts:
paths:
- public
only:
- master

View File

@ -1 +0,0 @@
8T6Fl0FSgyx68Z8hXpcm2tBO31j6q7vylwBJiYvv2OQ.CpU7Tczxh1oEMK5KYXO2cu3syEqOIuT38UVhliQaydg

View File

@ -1,5 +1,6 @@
# mat.services # mat.services
## my personal site
> my personal site built using zola and nix
wip inspired by <https://ilanjoselevich.com/blog/building-websites-using-nix-flakes-and-zola/>

28
config.toml Normal file
View File

@ -0,0 +1,28 @@
# The URL the site will be built for
base_url = "https://mat.services"
title = "mat.services"
# Whether to automatically compile all Sass files in the sass directory
compile_sass = true
# Whether to build a search index to be used later on by a JavaScript library
build_search_index = false
theme = "apollo"
[markdown]
# Whether to do syntax highlighting
highlight_code = true
[extra]
theme = "auto"
favicon = "/favicon.svg"
stylesheets = ["extra.css"]
menu = [
{ name = "/posts", url = "/posts", external = false },
{ name = "/projects", url = "/projects", external = false },
{ name = "/about", url = "/about", external = false },
{ name = "git", url = "https://git.mat.services/explore/repos", external = true },
]

15
content/about.md Normal file
View File

@ -0,0 +1,15 @@
+++
title = "about me"
path = "about"
+++
# matthew ess
i'm a 'software engineer'/'code monkey' by trade, currently employed by yelp inc in the engineering effectiveness department. my work is focused on improving the tooling used by other engineers at yelp to develop python services.
[you can look at my resume here](/resume).
in my spare time, i try to research programming language theory and practice, hack on useful tools, and change the world. in reality, i spend a considerable amount of time consuming movies and television, but i'm always looking for inspiration and opportunities to pursue my passions.
## contact
email: mat@mat.services

5
content/posts/_index.md Normal file
View File

@ -0,0 +1,5 @@
+++
path = "posts"
template = "posts.html"
sort_by = "date"
+++

View File

@ -0,0 +1,146 @@
+++
title = "diy code hosting with gitea and fly.io"
date = "2022-08-07"
+++
## Setting the scene
Inspired by the [Give Up Github campaign](https://sfconservancy.org/GiveUpGitHub/), I recently decided I wanted to spin up my own instance of [Gitea](https://gitea.io/). There are free (as in beer), free (as in freedom), public instances of Gitea and other FOSS-leaning code forges, but self-hosted Gitea struck me as a nice way to take even a bit more ownership over my own code.
I maintain a small PC running in my home as a server for a few services running via Proxmox, but I am really dissatisfied with my workflows for managing that box lately (picture SSHing into LXC containers and manually editing systemd configurations... yuck). I recently read a couple of different articles singing the praises of [Fly.io](https://fly.io/), a platform as a service (PaaS) that replicates most of the good parts of the classic Heroku developer experience. Further enticed by their generous-looking free tier, I took the plunge and created a Fly.io account.
## Getting started
First things first: in order to interact with Fly.io, we primarily use the `flyctl` command line tool. It's available from a variety of sources:
```bash
# Nix
nix-shell -p flyctl
nix-env -iA nixpkgs.flyctl
# macOS
brew install flyctl
# Linux + non-Homebrew users
curl -L https://fly.io/install.sh | sh
# Windows users
iwr https://fly.io/install.ps1 -useb | iex
```
`flyctl` can handle signing up for a Fly.io account if you haven't done that, otherwise you can use it to sign in:
```bash
# Opens your browser to set up an account
# This step requires a credit card, in the event you exceed the free tier limits
# See https://fly.io/docs/about/pricing/ for details
flyctl auth signup
# Opens your browser to sign in
flyctl auth login
```
## Configuring apps with `flyctl`
In order to avoid even the appearance of disorganization, we'll start off with a git repository for tracking our Fly.io configurations:
```bash
mkdir fly-apps; cd fly-apps
git init
mkdir gitea; cd gitea
```
Next up, we create our app configuration and register it with Fly.io. `flyctl` takes care of this for us in a single command, `flyctl launch`. The command will prompt you interactively for some input, but here we'll just pass some flags directly:
```bash
flyctl launch \
# use the official Gitea docker image \
--image gitea/gitea:latest \
# give our instance a unique name, this will be used to generate a development hostname like gitea-mat-services.fly.dev \
--name gitea-mat-services \
# region where the app runs, don't supply this option if you want to interactively choose a region \
--region ewr \
# don't immediately deploy, we need to edit our fly.toml first \
--no-deploy
# don't forget to commit!
git add fly.toml
git commit -m "Add default generated configuration"
```
We will also need a volume for persisting git repositories:
```bash
# Create a 3GB volume
# Note: this will consume your entire free tier allotment for volume storage!
flyctl volumes create gitea_data
# Alternatively, create a smaller volume
flyctl volumes create gitea_data --size 1
```
Now our app is ready to deploy, but first we're going to make some changes to the `fly.toml` configuration that was generated for us. [Gitea has their own post on Fly.io which includes a sample configuration](https://blog.gitea.io/2022/04/running-gitea-on-fly.io/), and we can reference that to end up with something like the following:
```diff
<snip>
[env]
+ GITEA____APP_NAME = "git.mat.services: Gitea for me"
+ GITEA__database__DB_TYPE = "sqlite3"
+ GITEA__database__PATH = "/data/gitea/gitea.db"
+ GITEA__server__DOMAIN = "gitea-on-fly.fly.dev"
+ GITEA__server__SSH_DOMAIN = "gitea-on-fly.fly.dev"
+ GITEA__server__ROOT_URL = "https://gitea-on-fly.fly.dev"
+ GITEA__security__INSTALL_LOCK = "true" # Don't show installer
+ # GITEA__service__DISABLE_REGISTRATION = "true" # TODO: uncomment once you have created your first user
+ [mounts]
+ destination = "/data"
+ source = "gitea_data"
<snip>
+ # ssh traffic
+ [[services]]
+ internal_port = 22
+ protocol = "tcp"
+ [[services.ports]]
+ port = 22
[[services]]
<snip>
- internal_port = 8080
+ internal_port = 3000
<snip>
```
Don't forget to save your work!
```bash
git add fly.toml
git commit -m "Add Gitea specific configuration"
```
## Liftoff!
The stars are aligned. The witching hour has arrived. Let's deploy our app:
```bash
flyctl deploy
```
After `flyctl` does its thing, your Gitea instance should be up and running at `https://<your-app-name>.fly.dev`! For the extremely lazy, `flyctl` will do the work for you:
```bash
flyctl open
```
Now you can register your account! If you want to keep your Gitea instance private, uncomment the last line in the `env` section and rerun `flyctl deploy` after registering.
## Bonus round: configuring your custom domain with Fly.io
Some, like myself, will not be satisfied accessing their Gitea instances with a `.fly.dev` URL. Thankfully, Fly.io makes it a breeze to configure a secure custom domain with the help of LetsEncrypt.
Fly.io and `flyctl` seem to offer tooling for managing your domains and DNS records entirely within the Fly.io system, but I personally didn't explore this route, as my own domains and DNS records are managed elsewhere. Whatever you use to manage your own domains and DNS, you will need to create two records for your domain name corresponding with the IPv4 and IPv6 addresses of the application:
```bash
flyctl ips list
TYPE ADDRESS REGION CREATED AT
v4 1.2.3.4 global 2022-07-03T04:39:18Z
v6 dead:beef:1::a:a global 2022-07-03T04:39:19Z
```
Create an A record for the v4 address, and an AAAA record for the v6 address. With those records in place, you should be clear to provision a certificate:
```bash
flyctl certs add git.mat.services
```
Now open up your custom domain and revel in your new code hosting powers.
### Acknowledgements
- [Thank you to Xe Iaso for xer blog post on Fly.io that inspired me to try it in the first place!](https://xeiaso.net/blog/fly.io-heroku-replacement)
- [Thank you to techknowlogick for their instructive post on running Gitea on Fly.io!](https://blog.gitea.io/2022/04/running-gitea-on-fly.io/)

12
content/projects.md Normal file
View File

@ -0,0 +1,12 @@
+++
title = "selected projects"
path = "projects"
+++
# gemini for rust
`gemini` is a rust crate providing a small set of types useful for working with the Gemini protocol
[`gemini` on crates.io](https://crates.io/crates/gemini)
[`gemini` source on the pijul nest](https://nest.pijul.com/mat/gemini-projects:main/5II6T7YETYWUI.BEAAA)

41
content/resume.md Normal file
View File

@ -0,0 +1,41 @@
+++
title = "resume"
path = "resume"
+++
# skills
## professional
* python
* relational databases
* redshift
* mysql
* apache spark
* flink
## personal
* nix package maanger
* rust
* haskell
* java
# experience
## yelp inc, 2017-present
### 2022-present
_software engineer, core services team_
### 2019-2022
_software engineer, marketplace data observability team_
### 2018-2019
_software engineer, food ordering experience team_
### 2017
_software engineering intern, transactions team_
# education
## purdue university, 2014-2018
_bachelor of science, computer science_

65
flake.lock Normal file
View File

@ -0,0 +1,65 @@
{
"nodes": {
"apollo": {
"flake": false,
"locked": {
"lastModified": 1653996138,
"narHash": "sha256-zZL3UinCbvu+gHdefqCt3ymuEPyzyIAWdGmpdruOb1U=",
"owner": "not-matthias",
"repo": "apollo",
"rev": "04ded9ffd63fd3dd085da72c4153057001b67003",
"type": "github"
},
"original": {
"owner": "not-matthias",
"repo": "apollo",
"type": "github"
}
},
"flake-parts": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1657102481,
"narHash": "sha256-62Fuw8JgPub38OdgNefkIKOodM9nC3M0AG6lS+7smf4=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "608ed3502263d6f4f886d75c48fc2b444a4ab8d8",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1659803779,
"narHash": "sha256-+5zkHlbcbFyN5f3buO1RAZ9pH1wXLxCesUJ0vFmLr9Y=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "f44884060cb94240efbe55620f38a8ec8d9af601",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"apollo": "apollo",
"flake-parts": "flake-parts",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

43
flake.nix Normal file
View File

@ -0,0 +1,43 @@
{
description = "personal site";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
flake-parts.inputs.nixpkgs.follows = "nixpkgs";
apollo.url = "github:not-matthias/apollo";
apollo.flake = false;
};
outputs = { self, flake-parts, ... }@inputs:
let
theme = inputs.apollo;
themeName = ((builtins.fromTOML (builtins.readFile "${theme}/theme.toml")).name);
in
flake-parts.lib.mkFlake { inherit self; } {
imports = [ ];
systems = inputs.nixpkgs.lib.systems.flakeExposed;
perSystem = { config, self', inputs', pkgs, system, ... }: {
packages.default = pkgs.stdenv.mkDerivation {
pname = "personal-site";
version = "2022-08-07";
src = ./.;
nativeBuildInputs = [ pkgs.zola ];
configurePhase = ''
mkdir -p "themes/${themeName}"
cp -r ${theme}/* "themes/${themeName}"
'';
buildPhase = "zola build";
installPhase = "cp -r public $out";
};
devShells.default = pkgs.mkShell {
packages = [ pkgs.zola ];
shellHook = ''
mkdir -p themes
ln -sn "${theme}" "themes/${themeName}"
'';
};
};
};
}

39
sass/extra.scss Normal file
View File

@ -0,0 +1,39 @@
// Logo
div.brand>* {
padding: 0 0.25em;
}
div.brand:hover img.logo {
filter: brightness(0) invert(1);
}
img.logo {
border: none;
height: 0.75em;
width: 0.75em;
padding-right: 0.25em;
}
// Footer
.content {
display: flex;
flex-direction: column;
min-height: 100vh;
}
div.inner {
flex-grow: 1;
}
header,
footer {
flex-grow: 0;
flex-shrink: 0;
}
footer {
margin: 2em;
color: grey;
font-size: 0.75em;
}

10
sass/theme/dark.scss Normal file
View File

@ -0,0 +1,10 @@
:root {
--text-0: rgba(255, 255, 255, 87%);
--text-1: rgba(255, 255, 255, 60%);
--bg-0: #121212;
--bg-1: rgba(255, 255, 255, 5%);
--primary-color: lightcoral;
--hover-color: white;
}

10
sass/theme/light.scss Normal file
View File

@ -0,0 +1,10 @@
:root {
--text-0: rgba(0, 0, 0, 87%);
--text-1: rgba(0, 0, 0, 66%);
--bg-0: #fff;
--bg-1: #f2f2f2;
--primary-color: lightcoral;
--hover-color: white;
}

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>matthew ess</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<meta name="description" content="matthew ess's personal site" />
<link rel="stylesheet" href="style.css" />
</head>
<body>
<h1>matthew ess</h1>
<p>is working on making something nice here</p>
</body>
</html>

View File

@ -1,9 +0,0 @@
body {
background-color: #ddacd4;
margin: 2em;
}
h1, p {
color: #34415e;
font-family: -apple-system, BlinkMacSystemFont, Helvetica, sans-serif;
}

3
static/favicon.svg Normal file
View File

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://web.resource.org/cc/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" baseProfile="full" width="512px" height="512px" viewBox="0 0 512 512" preserveAspectRatio="xMidYMid meet" id="svg_document" style="zoom: 1;"><!-- Created with macSVG - https://macsvg.org/ - https://github.com/dsward2/macsvg/ --><title id="svg_document_title">Untitled.svg</title><defs id="svg_document_defs"><clipPath id="halfCircle"><rect y="0%" id="rect1" width="50%" height="100%" x="50%"></rect></clipPath><clipPath id="smallHalfCircle"><rect y="50%" id="rect2" width="100%" height="100%" x="0%"></rect></clipPath></defs><g id="main_group"><rect stroke="lightcoral" id="background_rect" stroke-width="16" x="8" rx="64" width="496px" y="8" fill="none" stroke-linejoin="round" ry="64" height="496px"></rect><circle clip-path="url(#halfCircle)" id="circle1" cy="256px" fill="lightcoral" r="40%" cx="256px" visibility="visible"></circle><circle clip-path="url(#smallHalfCircle)" id="circle2" cy="256px" fill="lightcoral" r="40%" cx="256px" visibility="visible"></circle></g></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

22
templates/base.html Normal file
View File

@ -0,0 +1,22 @@
{% import "macros/macros.html" as post_macros %}
<!DOCTYPE html>
<html>
{% include "partials/header.html" %}
<body>
<div class="content">
{% include "partials/nav.html" %}
{# Post page is the default #}
<div class="inner">
{% block main_content %}
Nothing here?!
{% endblock main_content %}
</div>
{% include "partials/footer.html" %}
</div>
</body>
</html>

5
templates/index.html Normal file
View File

@ -0,0 +1,5 @@
{% extends "base.html" %}
{% block main_content %}
{{ post_macros::page_header(title="a sadware company")}}
{% endblock main_content %}

View File

@ -0,0 +1,6 @@
<footer>
<p>powered by <a href="https://getzola.org" target="_blank" rel="noopener noreferral">zola</a> + <a
href="https://github.com/not-matthias/apollo" target="_blank" rel="noopener noreferral">apollo</a> and
<a href="https://nixos.org" target="_blank" rel="noopener noreferral">nix</a>.
</p>
</footer>

View File

@ -0,0 +1,15 @@
<header>
<div class="main brand">
<a href={{ config.base_url }}><img class=logo src="/favicon.svg" />{{ config.title }}</a>
</div>
<nav>
{% for menu in config.extra.menu %}
{%- if menu.external %}
<a href={{ menu.url }} style="margin-left: 0.7em" target="_blank" rel="noopener noreferrer">{{ menu.name }}</a>
{%- else %}
<a href={{ menu.url }} style="margin-left: 0.7em">{{ menu.name }}</a>
{%- endif -%}
{% endfor %}
</nav>
</header>

32
templates/posts.html Normal file
View File

@ -0,0 +1,32 @@
{% extends "base.html" %}
{% block main_content %}
{{ post_macros::page_header(title="blog posts") }}
<main class="list">
{%- if paginator %}
{%- set show_pages = paginator.pages -%}
{% else %}
{% set section = get_section(path="posts/_index.md") %}
{%- set show_pages = section.pages -%}
{% endif -%}
{{ post_macros::list_posts(pages=show_pages) }}
</main>
{% if paginator %}
<ul class="pagination">
{% if paginator.previous %}
<span class="page-item page-prev">
<a href={{ paginator.previous }} class="page-link" aria-label="Previous"><span aria-hidden="true">← Prev</span></a>
</span>
{% endif %}
{% if paginator.next %}
<span class="page-item page-next">
<a href={{ paginator.next }} class="page-link" aria-label="Next"><span aria-hidden="true">Next →</span></a>
</span>
{% endif %}
</ul>
{% endif %}
{% endblock main_content %}