infrastructure

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit d256788ef3388af3578dd2744720bd7a401f5b31
parent 28d8f311c66cb613b9939315fbe5f64e854d5568
Author: Silas Brack <silasbrack@gmail.com>
Date:   Fri,  3 Apr 2026 17:24:08 +0200

feat: add blog

Diffstat:
Mflake.lock | 19++++++++++++++++++-
Mflake.nix | 7++++++-
Mnixos/configuration-debian-2gb-hel1-1.nix | 26++++++++++++++++++++++++++
3 files changed, 50 insertions(+), 2 deletions(-)

diff --git a/flake.lock b/flake.lock @@ -156,7 +156,8 @@ "mkv": "mkv", "nixpkgs": "nixpkgs_2", "simple-web-app": "simple-web-app", - "sops-nix": "sops-nix" + "sops-nix": "sops-nix", + "website": "website" } }, "simple-web-app": { @@ -237,6 +238,22 @@ "repo": "uv2nix", "type": "github" } + }, + "website": { + "flake": false, + "locked": { + "lastModified": 1773178829, + "narHash": "sha256-9+4hywqoXnamDQH5A4xZqIhaqByYM5MZ9FSTpSPkEjk=", + "owner": "silasbrack", + "repo": "silasbrack.github.io", + "rev": "2c95a2e9d7ab83d0dbf51d1317997b57f35d43e8", + "type": "github" + }, + "original": { + "owner": "silasbrack", + "repo": "silasbrack.github.io", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix @@ -4,6 +4,10 @@ sops-nix.url = "github:Mic92/sops-nix"; simple-web-app.url = "github:silasbrack/simple-web-app"; mkv.url = "git+ssh://git@github.com/silasbrack/mkv"; + website = { + url = "github:silasbrack/silasbrack.github.io"; + flake = false; + }; }; outputs = { @@ -11,6 +15,7 @@ sops-nix, simple-web-app, mkv, + website, ... }: let @@ -35,7 +40,7 @@ pkgs, ... }: - import ./nixos/configuration-debian-2gb-hel1-1.nix (inputs // { inherit simple-web-app mkv; }) + import ./nixos/configuration-debian-2gb-hel1-1.nix (inputs // { inherit simple-web-app mkv website; }) ) ]; }; diff --git a/nixos/configuration-debian-2gb-hel1-1.nix b/nixos/configuration-debian-2gb-hel1-1.nix @@ -4,6 +4,7 @@ lib, simple-web-app, mkv, + website, ... }: { @@ -201,6 +202,31 @@ }; }; + # Personal website (test at fnarglebeast.com/blog, later move to silasbrack.com) + services.nginx.virtualHosts."fnarglebeast.com" = let + staticSite = pkgs.runCommand "website" {} '' + mkdir -p $out + cp ${website}/index.html $out/ + cp ${website}/style.css $out/ + cp ${website}/style.min.css $out/ + cp -r ${website}/posts $out/ + cp -r ${website}/assets $out/ + ''; + in { + enableACME = true; + forceSSL = true; + extraConfig = '' + limit_req zone=ratelimit burst=20 nodelay; + ''; + locations."/blog" = { + alias = staticSite; + index = "index.html"; + extraConfig = '' + try_files $uri $uri/ /blog/index.html; + ''; + }; + }; + # services.simple-web-app = { # enable = true; # package = simple-web-app.packages."x86_64-linux".default;