clan/machines/moritz-server/website/root/default.nix

26 lines
666 B
Nix

{
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}";
}