feat: add static website
This commit is contained in:
parent
b714d906d8
commit
d4e8bde4cd
9 changed files with 110 additions and 11 deletions
26
machines/moritz-server/website/root/default.nix
Normal file
26
machines/moritz-server/website/root/default.nix
Normal 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}";
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue