build static websites using jekyll, on nix
Find a file
2024-12-07 02:56:42 +00:00
test-files Add simple README and fix tests 2024-12-06 15:18:02 +00:00
.gitignore Initial commit 2024-12-06 13:43:50 +00:00
flake.lock Add simple README and fix tests 2024-12-06 15:18:02 +00:00
flake.nix Export lib.mkJekyllSite 2024-12-07 02:56:42 +00:00
LICENSE Initial commit 2024-12-06 13:43:50 +00:00
README.md Finish README 2024-12-06 15:21:41 +00:00
tests.nix Add simple README and fix tests 2024-12-06 15:18:02 +00:00

nix-jekyll-builder

A Nix flake for building Jekyll sites with reproducible builds and minified output.

Features

  • Reproducible Jekyll site builds
  • HTML minification included
  • Bundler environment management
  • Configurable gem dependencies
  • Testing framework included

Usage

Basic Usage

In your Jekyll site's flake.nix:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
    nix-jekyll-builder.url = "git+https://git.chobble.com/chobble/nix-jekyll-builder";
  };

  outputs = { self, nixpkgs, nix-jekyll-builder }:
    let
      system = "x86_64-linux"; # or your system
    in {
      packages.${system}.default = nix-jekyll-builder.lib.${system}.mkJekyllSite {
        pname = "my-jekyll-site";
        src = ./.;
      };
    };
}

Custom Configuration

You can customize the build by providing your own Gemfile, lockfile, and gemset:

nix-jekyll-builder.lib.${system}.mkJekyllSite {
  pname = "my-jekyll-site";
  version = "1.0.0";  # optional
  src = ./.;
  gemfile = ./Gemfile;
  lockfile = ./Gemfile.lock;
  gemset = ./gemset.nix;
}

Generating gemset.nix

# In your project directory with Gemfile present
nix-shell -p bundix --run "bundix -l"

Running Tests

nix run .#test

Requirements

  • Nix with flakes enabled
  • Ruby gems specified in your Gemfile