Files
Foundry/hosts/alcyone/services/cincobola.nix
T
Gabriel Fontes 7885b414a4 format with alejandra
okay i'm not a big fan of nixfmt in the end
2024-04-07 14:21:47 -03:00

46 lines
1.1 KiB
Nix

# Something I did for a UI/UX class I took
# Decided to keep around to help out freshmen
{pkgs, ...}: let
cincobola = pkgs.stdenv.mkDerivation {
name = "cincobola";
JEKYLL_ENV = "production";
src = pkgs.fetchFromGitHub {
owner = "misterio77";
repo = "BSI-SCC0560";
rev = "bd1dcc3";
hash = "sha256-npPYxuZkqZWS0nRGc9IpTNviWzF5sFNUeVTdS6486lg=";
};
buildInputs = [pkgs.jekyll];
buildPhase = ''
jekyll build
'';
installPhase = ''
cp -r _site -T $out
'';
};
days = n: (hours n) * 24;
hours = n: (minutes n) * 60;
minutes = n: n * 60;
in {
services.nginx.virtualHosts."cincobola.misterio.me" = {
forceSSL = true;
enableACME = true;
locations = {
"/" = {
root = cincobola;
tryFiles = "$uri $uri.html $uri/ =404";
extraConfig = ''
error_page 404 /404.html;
add_header Cache-Control "max-age=${toString (minutes 15)}";
'';
};
"/assets/" = {
root = cincobola;
extraConfig = ''
add_header Cache-Control "max-age=${toString (days 30)}";
'';
};
};
};
}