Skip to content

Latest commit

 

History

History
71 lines (52 loc) · 2.26 KB

README.md

File metadata and controls

71 lines (52 loc) · 2.26 KB

Cloudflare Workers Wrangler SDK Flake

Packaged Cloudflare Wrangler SDK (github repo) in a Nix flake.

Why?

wrangler is already bundled with nixpkgs. You can use it as a standard nix package as you would any other package...

  packages = with pkgs; [
    wrangler
    # any other packages you want...
  ];

However, the release cadence of wrangler is high - typically releasing a new version every week - and it is not really possible for nixpkgs to keep up with this. Hence, the version of wrangler available in nixpkgs will usually be a little behind the latest version and if you're not using the master branch, it could potentially be significantly behind the latest version.

We hope to provide an update to wrangler on the nixpkgs master branch approximately every month or so.

If you want to use the most up to date version of wrangler, you can use this flake which is updated more frequently - we will try to update this within a few days of the latest wrangler release.

Usage

Get the recent release of wrangler from FlakeHub in your flake inputs:

{
  inputs.wrangler.url = "https://flakehub.com/f/ryand56/wrangler/*.tar.gz";

  outputs = { self, wrangler }: {
    # Use wrangler in your outputs
  };
}

A more specific example of how this can be used in a workers project is provided in examples/hello-world.

Using the NAR Cache

If you don't want to build the latest release of wrangler every time, you can skip the builds and download directly from my NAR cache.

{
  inputs.wrangler.url = "github:ryand56/wrangler";

  outputs = { self, wrangler }: {
    nix.settings = {
      substituters = [ "https://wrangler.cachix.org" ];
      trusted-public-keys = [ "wrangler.cachix.org-1:N/FIcG2qBQcolSpklb2IMDbsfjZKWg+ctxx0mSMXdSs=" ];
    };

    # Use wrangler in your outputs
  };
}

Maintainers