build static sites and host them on caddy
Find a file
2024-12-28 20:54:47 +00:00
.hooks Add pre-commit hook 2024-12-11 02:11:03 +00:00
builders Remove --offline from jekyll build 2024-12-07 22:54:23 +00:00
lib Fix SHA sum 2024-12-28 20:54:47 +00:00
modules Undelete { 2024-12-12 16:24:55 +00:00
tests Move customCaddy to here instead of chobble-server 2024-12-11 01:07:30 +00:00
.gitignore Refactoring some clunky pages, starting Jekyll tests 2024-12-06 17:11:36 +00:00
flake.lock Move customCaddy to here instead of chobble-server 2024-12-11 01:07:30 +00:00
flake.nix Fix SHA sum 2024-12-28 20:54:47 +00:00
LICENSE Add agpl3 license 2024-12-10 09:09:07 +00:00
README.md Fix tests 2024-12-06 16:02:32 +00:00

NixOS Static Site Builder

This flake grabs and builds static sites (maybe via a default.nix) and copies their outputs to /var/www

You can import it into your flake.nix like:

inputs = {
  site-builder = {
    url = "git+https://git.chobble.com/chobble/nixos-site-builder";
    inputs.nixpkgs.follows = "nixpkgs";
  };
};

and then add it as a module to your server's host, like:

({ config, ... }: {
  imports = [ site-builder.nixosModules.default ];
  services.site-builder = {
    enable = true;
    sites = {
      "chobble.com" = {
        gitRepo = "http://localhost:3000/chobble/chobble";
        wwwRedirect = true;
      };
      "veganprestwich.co.uk" = {
        gitRepo = "http://localhost:3000/chobble/vegan-prestwich";
        wwwRedirect = true;
      };
    };
  };
})

My Git repos in this example are hosted on localhost by my Forgejo instance but yours can be wherever.