feat: add static website

This commit is contained in:
Moritz Böhme 2025-05-16 09:57:24 +02:00
parent b714d906d8
commit d4e8bde4cd
No known key found for this signature in database
GPG key ID: 970C6E89EB0547A9
9 changed files with 110 additions and 11 deletions

View file

@ -0,0 +1,26 @@
{
pkgs,
inputs,
lib,
...
}: let
theme = inputs.zola-theme;
themeName = (builtins.fromTOML (builtins.readFile "${theme}/theme.toml")).name;
package = pkgs.stdenv.mkDerivation {
name = "static-website";
src = with lib.fileset;
toSource {
root = ./.;
fileset = difference (gitTracked ./.) (unions [./default.nix ./.envrc]);
};
nativeBuildInputs = [pkgs.zola];
configurePhase = ''
mkdir themes
ln -s ${theme} themes/${themeName}
'';
buildPhase = "zola build";
installPhase = "cp -r public $out";
};
in {
services.nginx.virtualHosts."moritz.place".locations."/".root = "${package}";
}