From 54668635e9a215576f19288d5fcb38bb855185f2 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Tue, 2 Sep 2025 19:19:45 -0400 Subject: [PATCH] caddy: fix senior project site --- flake.lock | 17 +++++++++++++++++ flake.nix | 5 +++++ services/caddy_senior_project.nix | 21 +++++++++++++++++++-- 3 files changed, 41 insertions(+), 2 deletions(-) diff --git a/flake.lock b/flake.lock index 9c94c53..7990d18 100644 --- a/flake.lock +++ b/flake.lock @@ -353,6 +353,7 @@ "nix-minecraft": "nix-minecraft", "nixos-hardware": "nixos-hardware", "nixpkgs": "nixpkgs", + "senior_project-website": "senior_project-website", "srvos": "srvos", "vpn-confinement": "vpn-confinement" } @@ -378,6 +379,22 @@ "type": "github" } }, + "senior_project-website": { + "flake": false, + "locked": { + "lastModified": 1756849912, + "narHash": "sha256-tBSyS/vksHbfeAWWEBIRxitkFx6tFj1QjrjNbnPdW5s=", + "owner": "Titaniumtown", + "repo": "senior-project-website", + "rev": "8c1d000091b0379f0741598a18f55dcbd6d47c66", + "type": "github" + }, + "original": { + "owner": "Titaniumtown", + "repo": "senior-project-website", + "type": "github" + } + }, "srvos": { "inputs": { "nixpkgs": [ diff --git a/flake.nix b/flake.nix index cac6f54..6210ab8 100644 --- a/flake.nix +++ b/flake.nix @@ -42,6 +42,11 @@ url = "github:serokell/deploy-rs"; inputs.nixpkgs.follows = "nixpkgs"; }; + + senior_project-website = { + url = "github:Titaniumtown/senior-project-website"; + flake = false; + }; }; outputs = diff --git a/services/caddy_senior_project.nix b/services/caddy_senior_project.nix index e37bd67..b206bcc 100644 --- a/services/caddy_senior_project.nix +++ b/services/caddy_senior_project.nix @@ -3,8 +3,25 @@ lib, pkgs, service_configs, + inputs, ... }: +let + hugoWebsite = pkgs.stdenv.mkDerivation { + pname = "hugo-site"; + version = "0.1"; + + src = inputs.senior_project-website; + + nativeBuildInputs = with pkgs; [ + hugo + ]; + + installPhase = '' + hugo --minify -d $out; + ''; + }; +in { imports = [ # TODO! fix conflicting definition values @@ -15,8 +32,8 @@ */ ]; - services.caddy.virtualHosts."senior-project".extraConfig = '' - root * ${service_configs.https.senior_project_dir} + services.caddy.virtualHosts."senior-project.${service_configs.https.domain}".extraConfig = '' + root * ${hugoWebsite} file_server browse '';