Compare commits
43 Commits
test-pr-br
...
main
Author | SHA1 | Date |
---|---|---|
mat ess | 9fe1e568f3 | |
mat ess | e4f9c6754b | |
mat ess | 6f748da235 | |
mat ess | 01f97682a1 | |
mat ess | 662f4032a4 | |
mat ess | d37694a1dc | |
mat ess | 95603a0e0a | |
mat ess | 96e9c2cc37 | |
mat ess | 5f7beb1de6 | |
mat ess | 3bf137fa3b | |
mat ess | 3a6842d053 | |
mat ess | 0ab4763af2 | |
mat ess | d1c1c0693b | |
mat ess | 44a65b4f90 | |
mat ess | f2634b2645 | |
mat ess | d77a5ec61c | |
mat ess | 70e1572294 | |
mat ess | 6fa52e8860 | |
mat ess | 8339d2bdbb | |
mat ess | b0390a0f02 | |
mat ess | 1f6e1dfb72 | |
mat ess | 2ffb142634 | |
mat ess | d24ed003f9 | |
mat ess | 2c48bb009d | |
mat ess | 9778b56610 | |
mat ess | 4d0be4e6f7 | |
mat ess | a77b87a344 | |
mat ess | 013246d114 | |
mat ess | 23894ff2b1 | |
mat ess | 4ef1b26206 | |
mat ess | 64a8c0f4e6 | |
mat ess | 4b8e9a0614 | |
mat ess | 0ac4175f21 | |
mat ess | 168297aa8f | |
mat ess | 130efc7383 | |
mat ess | a512e2a078 | |
mat ess | f66f7bfa4c | |
mat ess | 3d71e6ab08 | |
mat ess | d9964492f3 | |
mat ess | 3ecafc95e2 | |
mat ess | 4515264adf | |
mat ess | 490f46fde9 | |
mat | f1bd94338c |
|
@ -1,54 +1,64 @@
|
|||
local Volume = { name: 'site', path: '/site' };
|
||||
local PROD = 'production';
|
||||
local STAGE = 'staging';
|
||||
local NIX = 'nix --extra-experimental-features nix-command --extra-experimental-features flakes';
|
||||
|
||||
local Secrets(secrets) = {
|
||||
environment: {
|
||||
[secret]: { from_secret: std.asciiLower(secret) }
|
||||
for secret in secrets
|
||||
},
|
||||
};
|
||||
|
||||
local WhenProd(prod) = if prod then {
|
||||
event: ['promote'],
|
||||
target: ['production'],
|
||||
target: [PROD],
|
||||
} else {
|
||||
target: { exclude: ['production'] },
|
||||
target: { exclude: [PROD] },
|
||||
};
|
||||
local NixStep(env) =
|
||||
local prod = env == 'production';
|
||||
local output = if prod then '' else ' .#staging-site';
|
||||
|
||||
local Step(env, name, cmds, extras={}) =
|
||||
local prod = env == PROD;
|
||||
{
|
||||
name: 'nix build ' + env,
|
||||
name: name + ' ' + env,
|
||||
image: 'nixos/nix:latest',
|
||||
volumes: [Volume],
|
||||
commands: [
|
||||
'$NIX build' + output,
|
||||
'cp -r result/* /site/',
|
||||
volumes: [
|
||||
{ name: 'site', path: '/site' },
|
||||
{ name: 'cache', path: '/nix/store' },
|
||||
],
|
||||
commands: cmds,
|
||||
when: WhenProd(prod),
|
||||
};
|
||||
local NetlifyStep(env) =
|
||||
local prod = env == 'production';
|
||||
{
|
||||
name: 'netlify deploy ' + env,
|
||||
image: 'internetmat/drone-netlify:latest',
|
||||
pull: 'always',
|
||||
volumes: [Volume],
|
||||
settings: {
|
||||
token: { from_secret: 'netlify_token' },
|
||||
site: { from_secret: 'netlify_site_id' },
|
||||
alias: env,
|
||||
path: '/site',
|
||||
prod: prod,
|
||||
},
|
||||
when: WhenProd(prod),
|
||||
};
|
||||
} + extras;
|
||||
|
||||
local NixStep(env) =
|
||||
local prod = env == PROD;
|
||||
local output = if prod then '' else ' .#staging-site';
|
||||
Step(env, 'nix build', [
|
||||
NIX + ' build' + output,
|
||||
'cp -r result/* /site/',
|
||||
]);
|
||||
|
||||
local DeployStep(env) =
|
||||
local prod = env == PROD;
|
||||
local options = if prod then '--prod' else '--alias staging';
|
||||
Step(env, 'netlify deploy', [
|
||||
NIX + ' profile install nixpkgs#netlify-cli',
|
||||
'netlify deploy -d /site --auth $NETLIFY_TOKEN --site $NETLIFY_SITE_ID --message "$DRONE_COMMIT_MESSAGE" ' + options,
|
||||
], Secrets(['NETLIFY_TOKEN', 'NETLIFY_SITE_ID']));
|
||||
|
||||
{
|
||||
kind: 'pipeline',
|
||||
type: 'docker',
|
||||
name: 'default',
|
||||
|
||||
environment: {
|
||||
NIX: 'nix --extra-experimental-features nix-command --extra-experimental-features flakes',
|
||||
},
|
||||
|
||||
volumes: [{ name: 'site', temp: {} }],
|
||||
volumes: [
|
||||
{ name: 'site', temp: {} },
|
||||
{ name: 'cache', host: { path: '/data/cache' } },
|
||||
],
|
||||
|
||||
steps: [
|
||||
NixStep('staging'),
|
||||
NixStep('production'),
|
||||
NetlifyStep('staging'),
|
||||
NetlifyStep('production'),
|
||||
NixStep(STAGE),
|
||||
NixStep(PROD),
|
||||
DeployStep(STAGE),
|
||||
DeployStep(PROD),
|
||||
],
|
||||
}
|
||||
|
|
|
@ -10,3 +10,6 @@ static/style/fonts.css
|
|||
|
||||
# Local Netlify folder
|
||||
.netlify
|
||||
|
||||
# local pre-commit config
|
||||
.pre-commit-config.yaml
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# mat.services
|
||||
## my personal site
|
||||
[![Build Status](https://build.mat.services/api/badges/mat/mat.services/status.svg)](https://build.mat.services/mat/mat.services)
|
||||
[![Netlify Status](https://api.netlify.com/api/v1/badges/3f5578c4-e3f5-4c22-abb5-29fd22f34b42/deploy-status)](https://app.netlify.com/sites/mat-services/deploys)
|
||||
|
||||
built using zola and nix
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
[default.extend-words]
|
||||
referer = "referer"
|
|
@ -1,6 +1,6 @@
|
|||
base_url = "https://www.mat.services"
|
||||
title = "mat.services"
|
||||
description = "the personal website of matthew ess"
|
||||
description = "the personal website of mat ess"
|
||||
default_language = "en"
|
||||
|
||||
compile_sass = true
|
||||
|
@ -45,7 +45,6 @@ menu = [
|
|||
]
|
||||
|
||||
me_links = [
|
||||
{ name = "stereophonic.space", url = "https://stereophonic.space/mat" },
|
||||
{ name = "pijul nest", url = "https://nest.pijul.com/mat" },
|
||||
{ name = "lobste.rs", url = "https://lobste.rs/u/mat" },
|
||||
{ name = "gitlab", url = "https://gitlab.com/matthewess" },
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
+++
|
||||
title = "about me"
|
||||
path = "about"
|
||||
+++
|
||||
---
|
||||
title: "about me"
|
||||
path: "about"
|
||||
---
|
||||
|
||||
## matthew ess (they/them)
|
||||
## mat ess (they/them)
|
||||
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).
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
+++
|
||||
path = "posts"
|
||||
template = "posts.html"
|
||||
sort_by = "date"
|
||||
+++
|
||||
---
|
||||
path: "posts"
|
||||
template: "posts.html"
|
||||
sort_by: "date"
|
||||
---
|
|
@ -1,13 +1,13 @@
|
|||
+++
|
||||
title = "cellular automata toys in löve2d"
|
||||
date = "2022-09-15"
|
||||
description = "a short announcement post for a few interactive cellular automata toys written in lua"
|
||||
[taxonomies]
|
||||
tags = ["cellular-automata", "lua", "löve2d"]
|
||||
[extra]
|
||||
hero = true
|
||||
heroPrompt = "The oracle reading the future from Conway's Game of Life, technomancer aesthetic, digital illustration, 8k uhd"
|
||||
+++
|
||||
---
|
||||
title: "cellular automata toys in löve2d"
|
||||
date: "2022-09-15"
|
||||
description: "a short announcement post for a few interactive cellular automata toys written in lua"
|
||||
taxonomies:
|
||||
tags: ["cellular-automata", "lua", "löve2d"]
|
||||
extra:
|
||||
hero: true
|
||||
heroPrompt: "The oracle reading the future from Conway's Game of Life, technomancer aesthetic, digital illustration, 8k uhd"
|
||||
---
|
||||
|
||||
after reading [Andrew Healey's blog post about Langton's Ant](https://healeycodes.com/virtual-ants), i found myself inspired to reimplement some of his work. i've read numerous rave reviews of löve2d for writing simple toys, so i decided to give that a shot here as well. Langton's Ant went well enough that i also implemented Life and Wireworld.
|
||||
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
+++
|
||||
title = "passing command line arguments to nix flakes"
|
||||
date = "2022-10-10"
|
||||
description = "a tutorial on 'breaking' the hermeticity of nix flakes by adding convenient command line flags"
|
||||
[taxonomies]
|
||||
tags = ["nix"]
|
||||
[extra]
|
||||
hero = true
|
||||
heroPrompt = "A rogue program hacking through the firewall, in the style of Tron Legacy, cyberpunk vibe, digital render, 8k uhd, unreal engine"
|
||||
+++
|
||||
---
|
||||
title: "passing command line arguments to nix flakes"
|
||||
date: "2022-10-10"
|
||||
description: "a tutorial on 'breaking' the hermeticity of nix flakes by adding convenient command line flags"
|
||||
taxonomies:
|
||||
tags: ["nix"]
|
||||
extra:
|
||||
hero: true
|
||||
heroPrompt: "A rogue program hacking through the firewall, in the style of Tron Legacy, cyberpunk vibe, digital render, 8k uhd, unreal engine"
|
||||
---
|
||||
|
||||
[Nix flakes](https://serokell.io/blog/practical-nix-flakes) are very useful, but the feature of a [fully hermetic build](https://bazel.build/basics/hermeticity) also means that they carry with them a certain degree of inflexibility. [Users have asked for a mechanism to parameterize flakes](https://github.com/NixOS/nix/issues/2861#issuecomment-891521971), but there seems to be no interest from the Nix maintainers in adding such a feature.
|
||||
|
||||
|
@ -126,7 +126,7 @@ If software builds are functions, then Nix flakes are pure functions. Indeed, th
|
|||
builder.url = "...";
|
||||
source.url = "...";
|
||||
};
|
||||
ouputs = { self, builder, source }: {
|
||||
outputs = { self, builder, source }: {
|
||||
software = builder.build source;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
+++
|
||||
title = "diy code hosting with gitea and fly.io"
|
||||
date = "2022-08-07"
|
||||
updated = "2022-09-04"
|
||||
[taxonomies]
|
||||
tags = ["git", "gitea", "fly.io"]
|
||||
+++
|
||||
---
|
||||
title: "diy code hosting with gitea and fly.io"
|
||||
date: "2022-08-07"
|
||||
updated: "2022-09-04"
|
||||
taxonomies:
|
||||
tags: ["git", "gitea", "fly.io"]
|
||||
---
|
||||
|
||||
## 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.
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
+++
|
||||
title = "now on netlify"
|
||||
date = "2022-10-16"
|
||||
description = "a short update regarding me packing up my static site and moving from fly.io to netlify"
|
||||
[taxonomies]
|
||||
tags = ["static-site", "netlify"]
|
||||
[extra]
|
||||
hero = true
|
||||
heroPrompt = "A man packing up and leaving home to move to the city, luggage and boxes outside of his house, a moving truck idling in his driveway, gorgeous illustration, high quality art, masterpiece"
|
||||
+++
|
||||
---
|
||||
title: "now on netlify"
|
||||
date: "2022-10-16"
|
||||
description: "a short update regarding me packing up my static site and moving from fly.io to netlify"
|
||||
taxonomies:
|
||||
tags: ["static-site", "netlify"]
|
||||
extra:
|
||||
hero: true
|
||||
heroPrompt: "A man packing up and leaving home to move to the city, luggage and boxes outside of his house, a moving truck idling in his driveway, gorgeous illustration, high quality art, masterpiece"
|
||||
---
|
||||
|
||||
a short update today, and one that (unfortunately) obsoletes a lot of the work I put into [my last post on static site hosting](@/posts/static-site-with-nix-and-caddy/index.md): this site is now hosted on netlify! after [my most recent article](@/posts/command-line-flake-arguments/index.md) ran into some accessibility issues for people outside of my fly.io deployment region, I decided to minimize the moving parts involved in keeping the site running. i moved my static content over to [netlify](https://www.netlify.com/), a well-liked PaaS for deploying webapps and static sites (they also offer other things I don't care about, such as "Serverless" and FaaS offerings). [netlify's configuration file](https://docs.netlify.com/configure-builds/file-based-configuration/) supports all the same headers and redirects options that I was using in caddy, so the transition was extremely smooth.
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
+++
|
||||
title = "hosting a static site on fly.io with nix and caddy"
|
||||
date = "2022-09-04"
|
||||
updated = "2022-10-17"
|
||||
[taxonomies]
|
||||
tags = ["static-site", "nix", "caddy", "fly.io"]
|
||||
+++
|
||||
---
|
||||
title: "hosting a static site on fly.io with nix and caddy"
|
||||
date: "2022-09-04"
|
||||
updated: "2022-10-17"
|
||||
taxonomies:
|
||||
tags: ["static-site", "nix", "caddy", "fly.io"]
|
||||
---
|
||||
|
||||
**UPDATE**
|
||||
most of the information on this page is no longer accurate for my blog, [which has since moved to netlify](@/posts/now-on-netlify/index.md). it should still work, or get you close, but i recommend checking out [`nix-fly-template`](https://github.com/LutrisEng/nix-fly-template).
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
+++
|
||||
title = "privacy notice"
|
||||
path = "privacy"
|
||||
+++
|
||||
---
|
||||
title: "privacy notice"
|
||||
path: "privacy"
|
||||
---
|
||||
|
||||
## summary
|
||||
i want to respect your pivacy, while still getting some insight into the readership of my site. no "personally identifiable information" or "sensitive information" is collected, and no data is shared with external parties.
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
+++
|
||||
title = "selected projects"
|
||||
path = "projects"
|
||||
+++
|
||||
---
|
||||
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)
|
||||
|
||||
## mat.services
|
||||
the static sources for this site are publicly available. perhaps the most interesting files for inspection are the nix configurations.
|
||||
- [`mat.services` on git.mat.services](https://git.mat.services/mat/mat.services)
|
||||
|
||||
## other projects
|
||||
i am in the process of moving my active git-managed projects to a ["self"-hosted gitea instance](https://git.mat.services/mat), but currently some of my projects still live on [github](https://github.com/matthewess) or [gitlab](https://gitlab.com/matthewess). i occasionally work on projects using [pijul](https://pijul.org), which can be found on [the pijul nest](https://nest.pijul.com/mat).
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
+++
|
||||
title = "resume"
|
||||
path = "resume"
|
||||
+++
|
||||
---
|
||||
title: "resume"
|
||||
path: "resume"
|
||||
---
|
||||
|
||||
## skills
|
||||
### professional
|
||||
|
|
110
flake.lock
110
flake.lock
|
@ -16,18 +16,32 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1668681692,
|
||||
"narHash": "sha256-Ht91NGdewz8IQLtWZ9LCeNXMSXHUss+9COoqu6JLmXU=",
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"rev": "009399224d5e398d03b22badca40a37ac85412a1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "edolstra",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
"nixpkgs-lib": "nixpkgs-lib"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1664385320,
|
||||
"narHash": "sha256-uSCHb9RUqHRjTpI8OzyaUuHckFnnxwZqlXEuo+yUpYQ=",
|
||||
"lastModified": 1668450977,
|
||||
"narHash": "sha256-cfLhMhnvXn6x1vPm+Jow3RiFAUSCw/l1utktCw5rVA4=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "45298bd207b26e1bcd030a0bb075aa2da29f8e30",
|
||||
"rev": "d591857e9d7dd9ddbfba0ea02b43b927c3c0f1fa",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -36,6 +50,21 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-utils": {
|
||||
"locked": {
|
||||
"lastModified": 1667395993,
|
||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "flake-utils",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"gitignore": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
|
@ -58,11 +87,11 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1665259268,
|
||||
"narHash": "sha256-ONFhHBLv5nZKhwV/F2GOH16197PbvpyWhoO0AOyktkU=",
|
||||
"lastModified": 1670064435,
|
||||
"narHash": "sha256-+ELoY30UN+Pl3Yn7RWRPabykwebsVK/kYE9JsIsUMxQ=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "c5924154f000e6306030300592f4282949b2db6c",
|
||||
"rev": "61a8a98e6d557e6dd7ed0cdb54c3a3e3bbc5e25c",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@ -72,12 +101,73 @@
|
|||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
"lastModified": 1665349835,
|
||||
"narHash": "sha256-UK4urM3iN80UXQ7EaOappDzcisYIuEURFRoGQ/yPkug=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "34c5293a71ffdb2fe054eb5288adc1882c1eb0b1",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"dir": "lib",
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-unstable",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-stable": {
|
||||
"locked": {
|
||||
"lastModified": 1671271954,
|
||||
"narHash": "sha256-cSvu+bnvN08sOlTBWbBrKaBHQZq8mvk8bgpt0ZJ2Snc=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "d513b448cc2a6da2c8803e3c197c9fc7e67b19e3",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixos-22.05",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"pre-commit": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-utils": "flake-utils",
|
||||
"gitignore": [
|
||||
"gitignore"
|
||||
],
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"nixpkgs-stable": "nixpkgs-stable"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1671452357,
|
||||
"narHash": "sha256-HqzXiQEegpRQ4VEl9pEPgHSIxhJrNJ27HfN1wOc7w2E=",
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"rev": "200790e9c77064c53eaf95805b013d96615ecc27",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "pre-commit-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"caddyfile-syntax": "caddyfile-syntax",
|
||||
"flake-parts": "flake-parts",
|
||||
"gitignore": "gitignore",
|
||||
"nixpkgs": "nixpkgs"
|
||||
"nixpkgs": "nixpkgs",
|
||||
"pre-commit": "pre-commit"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
39
flake.nix
39
flake.nix
|
@ -4,19 +4,21 @@
|
|||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
flake-parts.inputs.nixpkgs.follows = "nixpkgs";
|
||||
gitignore.url = "github:hercules-ci/gitignore.nix";
|
||||
gitignore.inputs.nixpkgs.follows = "nixpkgs";
|
||||
pre-commit.url = "github:cachix/pre-commit-hooks.nix";
|
||||
pre-commit.inputs.nixpkgs.follows = "nixpkgs";
|
||||
pre-commit.inputs.gitignore.follows = "gitignore";
|
||||
|
||||
caddyfile-syntax.url = "github:caddyserver/sublimetext";
|
||||
caddyfile-syntax.flake = false;
|
||||
};
|
||||
|
||||
outputs = { self, flake-parts, gitignore, ... }@inputs:
|
||||
outputs = { self, flake-parts, gitignore, pre-commit, ... }@inputs:
|
||||
flake-parts.lib.mkFlake { inherit self; } {
|
||||
imports = [ ];
|
||||
imports = [ pre-commit.flakeModule ];
|
||||
systems = [ "x86_64-linux" "aarch64-darwin" ];
|
||||
perSystem = { config, self', inputs', pkgs, system, ... }:
|
||||
perSystem = { config, pkgs, ... }:
|
||||
let
|
||||
inherit (gitignore.lib) gitignoreSource;
|
||||
inherit (pkgs.callPackage ./nix { }) fonts optimize-images update-date;
|
||||
|
@ -24,25 +26,23 @@
|
|||
caddyfile-syntax = "${inputs.caddyfile-syntax}/Caddyfile.sublime-syntax";
|
||||
buildSite = { prod }:
|
||||
let
|
||||
inherit (pkgs.lib) optionalString;
|
||||
ifStaging = optionalString (!prod);
|
||||
rev = if (self ? rev) then self.rev else "dirty";
|
||||
ifStaging = pkgs.lib.optionalString (!prod);
|
||||
in
|
||||
''
|
||||
optimize-images
|
||||
zola build --drafts ${ifStaging "--base-url https://staging--mat-services.netlify.app"}
|
||||
# zola's ignored_content setting doesn't work in static/
|
||||
rm -rf public/image/_favicon.svg
|
||||
convert public/image/favicon.svg -resize 256x256 public/favicon.ico
|
||||
'';
|
||||
in
|
||||
{
|
||||
packages.default = with pkgs; stdenv.mkDerivation {
|
||||
pname = "personal-site";
|
||||
version = "2022-10-23";
|
||||
version = "2023-02-01";
|
||||
src = gitignoreSource ./.;
|
||||
nativeBuildInputs = [ imagemagick optimize-images update-date zola ];
|
||||
configurePhase = copyFonts + ''
|
||||
nativeBuildInputs = [ optimize-images update-date zola ];
|
||||
configurePhase = ''
|
||||
${copyFonts}
|
||||
mkdir -p extra/syntax
|
||||
cp ${caddyfile-syntax} extra/syntax
|
||||
'';
|
||||
|
@ -54,12 +54,25 @@
|
|||
packages.staging-site = config.packages.default.overrideAttrs (_: {
|
||||
buildPhase = buildSite { prod = false; };
|
||||
});
|
||||
pre-commit.settings.hooks = {
|
||||
# nix hooks
|
||||
deadnix.enable = true;
|
||||
nix-linter.enable = true;
|
||||
nixpkgs-fmt.enable = true;
|
||||
statix.enable = true;
|
||||
# general hooks
|
||||
typos.enable = true;
|
||||
typos.excludes = [ "webp" "png" "svg" "ico" ];
|
||||
};
|
||||
devShells.default = with pkgs; mkShell {
|
||||
packages = [ optimize-images update-date zola ];
|
||||
shellHook = linkFonts + ''
|
||||
packages = [ jsonnet netlify-cli optimize-images update-date zola ];
|
||||
shellHook = ''
|
||||
${config.pre-commit.installationScript}
|
||||
${linkFonts}
|
||||
mkdir -p extra/syntax
|
||||
ln -snf ${caddyfile-syntax} extra/syntax
|
||||
'';
|
||||
inputsFrom = builtins.attrValues self.checks;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
img-src 'self' https://stats.mat.services;
|
||||
style-src 'self' 'unsafe-inline';
|
||||
font-src 'self';
|
||||
script-src 'sha256-a8rh6u3maZ6JiY6w6zsLlw9OUQf2tFPUX3t1/BV+RKc=' 'strict-dynamic';
|
||||
script-src 'self' https://stats.mat.services;
|
||||
form-action 'none';
|
||||
frame-ancestors 'none';
|
||||
base-uri 'none';
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
, lib
|
||||
, stdenv
|
||||
, woff2
|
||||
, writeShellScriptBin
|
||||
, writeText
|
||||
}:
|
||||
let
|
||||
|
@ -45,7 +44,7 @@ rec {
|
|||
name = "font-${pathName name}";
|
||||
src = fetchFromGitHub {
|
||||
inherit owner repo rev sha256;
|
||||
sparseCheckout = path;
|
||||
sparseCheckout = [ path ];
|
||||
};
|
||||
nativeBuildInputs = [ woff2 ];
|
||||
buildPhase = ''
|
||||
|
@ -61,7 +60,7 @@ rec {
|
|||
font = fontDerivation fontSrc;
|
||||
};
|
||||
fonts = map fetchFont fontSrcs;
|
||||
mkFontCss = { font, name, fileName, cssVar }:
|
||||
mkFontCss = { name, fileName, cssVar, ... }:
|
||||
let path = pathName name; in ''
|
||||
@font-face {
|
||||
font-family: '${name}';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ bc, libwebp, scour, writeShellScriptBin }:
|
||||
{ bc, imagemagick, libwebp, scour, writeShellScriptBin }:
|
||||
|
||||
writeShellScriptBin "optimize-images" ''
|
||||
shopt -s globstar nullglob
|
||||
|
@ -14,4 +14,5 @@ writeShellScriptBin "optimize-images" ''
|
|||
pct=$(${bc}/bin/bc <<< "scale=1; $newsize * 100 / $oldsize")
|
||||
echo "size went from "$(($oldsize / 1024))"KB to "$(($newsize / 1024))"KB ("$pct"% as large as original)"
|
||||
done
|
||||
${imagemagick}/bin/convert static/image/favicon.svg -resize 256x256 static/favicon.ico
|
||||
''
|
||||
|
|
|
@ -47,8 +47,9 @@ html {
|
|||
}
|
||||
|
||||
// Logo
|
||||
div.brand>* {
|
||||
padding: 0 0.25em;
|
||||
div.brand > * {
|
||||
padding-left: 0.25em;
|
||||
padding-right: 0.25em;
|
||||
}
|
||||
|
||||
div.brand:hover img#logo {
|
||||
|
@ -69,13 +70,21 @@ nav a {
|
|||
}
|
||||
|
||||
// Footer
|
||||
html, body {
|
||||
box-sizing: border-box;
|
||||
height: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
min-height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
div.inner {
|
||||
main.inner {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
|
@ -89,6 +98,10 @@ footer {
|
|||
margin: 2em;
|
||||
color: var(--text-1);
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
||||
@media (min-width: 500px) {
|
||||
footer {
|
||||
display: flex;
|
||||
|
||||
#site-info {
|
||||
|
@ -98,6 +111,7 @@ footer {
|
|||
#copyright {
|
||||
align-items: flex-end;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Post list
|
||||
|
|
|
@ -31,7 +31,7 @@ header {
|
|||
}
|
||||
|
||||
header .main {
|
||||
font-size: 1.5rem;
|
||||
font-size: 1.2rem;
|
||||
|
||||
/* Otherwise header and menu is too close on small screens*/
|
||||
margin-bottom: 10px;
|
||||
|
|
|
@ -11,12 +11,6 @@
|
|||
background-color: var(--primary-color);
|
||||
}
|
||||
|
||||
::-moz-selection {
|
||||
background: var(--primary-color);
|
||||
color: var(--hover-color);
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: var(--primary-color);
|
||||
color: var(--hover-color);
|
||||
|
@ -40,14 +34,27 @@ blockquote {
|
|||
}
|
||||
|
||||
a {
|
||||
border-bottom: 3px solid var(--primary-color);
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
box-shadow: inset 0 -3px 0 var(--primary-color);
|
||||
padding-bottom: 3px;
|
||||
transition: all .1s ease-in;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
background-color: var(--primary-color);
|
||||
color: var(--hover-color);
|
||||
box-shadow: inset 0 -1.45em 0 var(--primary-color);
|
||||
transition: all .3s ease;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce), (any-hover: none) {
|
||||
a {
|
||||
transition: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
transition: none;
|
||||
}
|
||||
}
|
||||
|
||||
time {
|
||||
|
|
|
@ -2,15 +2,6 @@
|
|||
content: "🏷 ";
|
||||
}
|
||||
|
||||
.tags a {
|
||||
border-bottom: 3px solid var(--primary-color);
|
||||
}
|
||||
|
||||
.tags a:hover {
|
||||
color: var(--hover_color);
|
||||
background-color: var(--primary-color);
|
||||
}
|
||||
|
||||
ul.tags {
|
||||
margin: 0.5rem;
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
|
@ -16,7 +16,7 @@
|
|||
</author>
|
||||
<link href="{{ feed_url | safe }}" rel="self" type="application/atom+xml"/>
|
||||
<icon>{{ get_url(path=config.extra.favicon) }}</icon>
|
||||
<rights>© 2022 mat ess</rights>
|
||||
<rights>© 2022-2023 mat ess</rights>
|
||||
<generator uri="https://www.getzola.org/">Zola</generator>
|
||||
<updated>{{ last_updated | date(format="%+") }}</updated>
|
||||
<id>{{ feed_url | safe }}</id>
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
<span>also on
|
||||
{%- for me in config.extra.me_links -%}
|
||||
{%- if loop.last -%}
|
||||
<span> and </span>
|
||||
 and 
|
||||
{%- endif %}
|
||||
<a href="{{ me.url | safe }}" target="_blank" rel="me noopener noreferrer">{{ me.name }}</a>
|
||||
{%- if not loop.last -%},{%- else %}
|
||||
</span>
|
||||
{%- endif -%}
|
||||
{% endfor -%}
|
||||
{% endfor %}
|
||||
{% endblock main_content %}
|
|
@ -3,14 +3,14 @@
|
|||
<p id="powered-by">
|
||||
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>.
|
||||
<a href="https://nixos.org" target="_blank" rel="noopener noreferral">nix</a>
|
||||
</p>
|
||||
<p id="privacy-note">
|
||||
<a href="/privacy">privacy notice</a>.
|
||||
<a href="/privacy">privacy notice</a>
|
||||
</p>
|
||||
</div>
|
||||
<p id="copyright">
|
||||
© 2022 mat ess.
|
||||
© 2022-2023 mat ess
|
||||
</p>
|
||||
<script data-goatcounter="https://stats.mat.services/count" async src="//stats.mat.services/count.js" crossorigin integrity="sha256-a8rh6u3maZ6JiY6w6zsLlw9OUQf2tFPUX3t1/BV+RKc="></script>
|
||||
<noscript>
|
||||
|
|
|
@ -10,11 +10,9 @@
|
|||
<link rel="icon" type="image/{{ favicon_ext }}" href="{{ get_url(path=config.extra.favicon, cachebust=true) }}" />
|
||||
{%- endif -%}
|
||||
{% for font in config.extra.fonts -%}
|
||||
{% for style in ["Bold", "BoldItalic", "Italic", "Regular"] -%}
|
||||
{% set font_path = '/font/' ~ font.path ~ '/' ~ font.name ~ '-' ~ style ~ '.woff2' %}
|
||||
{% set font_path = '/font/' ~ font.path ~ '/' ~ font.name ~ '-Regular.woff2' %}
|
||||
<link rel="preload" href="{{ get_url(path=font_path, trailing_slash=false) }}" as="font" type="font/woff2" crossorigin>
|
||||
{%- endfor %}
|
||||
{%- endfor %}
|
||||
<link href="{{ get_url(path='style/fonts.css', cachebust=true) }}" rel="stylesheet preload" as="style" />
|
||||
{# Atom #}
|
||||
{%- block rss -%}
|
||||
|
@ -24,6 +22,7 @@
|
|||
<link rel="stylesheet preload" as="style" type="text/css" href="{{ get_url(path='style/theme/light.css', cachebust=true) }}" />
|
||||
<link rel="stylesheet preload" as="style" type="text/css" href="{{ get_url(path='style/theme/dark.css', cachebust=true) }}" media="(prefers-color-scheme: dark)" />
|
||||
<link rel="stylesheet preload" as="style" type="text/css" media="screen" href="{{ get_url(path='style/main.css', cachebust=true) }}" />
|
||||
<meta name="theme-color" content="lightcoral" />
|
||||
{%- if config.extra.stylesheets -%}
|
||||
{%- for stylesheet in config.extra.stylesheets -%}
|
||||
<link rel="stylesheet" href="{{ get_url(path=stylesheet, cachebust=true) }}">
|
||||
|
@ -51,10 +50,10 @@
|
|||
<meta property="og:image" content="{{ get_url(path=current_path) }}/hero.webp">
|
||||
{%- endif -%}
|
||||
{#- Twitter #}
|
||||
<meta property="twitter:card" content="summary_large_image">
|
||||
<meta property="twitter:title" content="{{ current_title }}">
|
||||
<meta property="twitter:description" content="{{ current_description }}">
|
||||
{%- if hero -%}
|
||||
<meta property="twitter:image" content="{{ get_url(path=current_path) }}/hero.webp">
|
||||
<meta property="twitter:card" content="summary_large_image">
|
||||
{%- endif %}
|
||||
</head>
|
Loading…
Reference in New Issue