diff --git a/flake.lock b/flake.lock index 2191763..87dd72b 100644 --- a/flake.lock +++ b/flake.lock @@ -238,11 +238,11 @@ ] }, "locked": { - "lastModified": 1756841250, - "narHash": "sha256-VBFOuaNQZiRux2zNv2DThl10EOpEs8e4lz8xN/gnY2w=", + "lastModified": 1756867433, + "narHash": "sha256-/bOq85y2aXjKuu0g9bxp5irM+pXVK+kBT09xwZwBnPE=", "owner": "ggml-org", "repo": "llama.cpp", - "rev": "3de008208b9b8a33f49f979097a99b4d59e6e521", + "rev": "8a2234ea0c89f212190c176d741b7742f0082582", "type": "github" }, "original": { @@ -260,11 +260,11 @@ ] }, "locked": { - "lastModified": 1756692734, - "narHash": "sha256-i+nMeFwG7tHYWGvUYKvmg8FVPVnqLrZey9mLpdypPmA=", + "lastModified": 1756864213, + "narHash": "sha256-eHgsQ9eoJZGnZLJtrYnCynEb5nYhysvMtFrPiTwjHA0=", "owner": "Infinidoge", "repo": "nix-minecraft", - "rev": "3cfb5bddc3479ff7f403fa3d6cdbdfe2d25e54d5", + "rev": "da421c0fb247d3b1956b0cc68e73a27bcdcf77b5", "type": "github" }, "original": { @@ -355,7 +355,8 @@ "nixpkgs": "nixpkgs", "senior_project-website": "senior_project-website", "srvos": "srvos", - "vpn-confinement": "vpn-confinement" + "vpn-confinement": "vpn-confinement", + "website": "website" } }, "rust-overlay": { @@ -477,6 +478,22 @@ "repo": "VPN-Confinement", "type": "github" } + }, + "website": { + "flake": false, + "locked": { + "lastModified": 1756870892, + "narHash": "sha256-jPcADOXoREf92sA/wHX9tXfuRRDpwIba4NIqz/Gl8Kg=", + "ref": "refs/heads/main", + "rev": "890c7633d469862a54b9c5993050b1f287242f2d", + "revCount": 20, + "type": "git", + "url": "https://git.gardling.com/titaniumtown/website" + }, + "original": { + "type": "git", + "url": "https://git.gardling.com/titaniumtown/website" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 8aa6a0a..ee2a5db 100644 --- a/flake.nix +++ b/flake.nix @@ -47,6 +47,11 @@ url = "github:Titaniumtown/senior-project-website"; flake = false; }; + + website = { + url = "git+https://git.gardling.com/titaniumtown/website"; + flake = false; + }; }; outputs = @@ -93,9 +98,6 @@ https = { certs = services_dir + "/http_certs"; - # TODO! generate website from repo directly using hugo - data_dir = services_dir + "/http/www"; - domain = "gardling.com"; wg_ip = "192.168.15.1"; matrix_hostname = "matrix.${service_configs.https.domain}"; diff --git a/services/caddy.nix b/services/caddy.nix index 0cbe8a0..9e5869c 100644 --- a/services/caddy.nix +++ b/services/caddy.nix @@ -4,13 +4,49 @@ username, pkgs, lib, + inputs, ... }: + +let + theme = pkgs.fetchFromGitHub { + owner = "kaiiiz"; + repo = "hugo-theme-monochrome"; + rev = "d17e05715e91f41a842f2656e6bdd70cba73de91"; + sha256 = "h9I2ukugVrldIC3SXefS0L3R245oa+TuRChOCJJgF24="; + }; + + hugo-neko = pkgs.fetchFromGitHub { + owner = "ystepanoff"; + repo = "hugo-neko"; + rev = "5a50034acbb1ae0cec19775af64e7167ca22725e"; + sha256 = "VLwr4zEeFQU/b+vj0XTLSuEiosuNFu2du4uud7m8bnw="; + }; + + hugoWebsite = pkgs.stdenv.mkDerivation { + pname = "hugo-site"; + version = "0.1"; + + src = inputs.website; + + nativeBuildInputs = with pkgs; [ + hugo + go + git + ]; + + installPhase = '' + rm -fr themes/theme modules/hugo-neko + cp -r ${theme} themes/theme + cp -r ${hugo-neko} modules/hugo-neko + hugo --minify -d $out; + ''; + }; +in { imports = [ (lib.serviceMountDeps "caddy" [ config.services.caddy.dataDir - service_configs.https.data_dir ]) (lib.serviceDependZpool "caddy" service_configs.zpool_ssds) ]; @@ -21,7 +57,7 @@ virtualHosts = { ${service_configs.https.domain} = { extraConfig = '' - root * ${service_configs.https.data_dir} + root * ${hugoWebsite} file_server browse ''; @@ -31,7 +67,6 @@ }; systemd.tmpfiles.rules = [ - "d ${service_configs.https.data_dir} 770 ${config.services.caddy.user} ${config.services.caddy.group}" "d ${config.services.caddy.dataDir} 700 ${config.services.caddy.user} ${config.services.caddy.group}" ];