1
0
Fork 0
build static sites and host them on caddy
Find a file
2025-03-14 04:17:57 +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 Scrap custom caddy 2025-03-13 15:27:06 +00:00
modules Scrap custom caddy 2025-03-13 15:27:06 +00:00
tests Scrap custom caddy 2025-03-13 15:27:06 +00:00
.gitignore Refactoring some clunky pages, starting Jekyll tests 2024-12-06 17:11:36 +00:00
flake.lock Don't pin nixpkgs 2025-03-13 16:43:38 +00:00
flake.nix Don't pin nixpkgs 2025-03-13 16:43:38 +00:00
LICENSE Add agpl3 license 2024-12-10 09:09:07 +00:00
README.md Update README.md 2025-03-14 04:17:57 +00:00

⚠️ NOTE: This is unmaintained - I'm now using Forgejo actions to build and push sites instead, it's much simpler! ⚠️

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.