Quickly and reproducibly install Lix inside GitHub Actions by pinning static closures in your flake.nix.
Add bootstrap-lix to your flake.nix as follows:
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
bootstrap-lix.url = "github:stainless-em/bootstrap-lix";
};
outputs = { nixpkgs, bootstrap-lix, ... }:
assert bootstrap-lix.lib.assertBootstrap {
inherit nixpkgs;
paths = "";
};
{
# ... your flake outputs here ...
}
}Next, evaluate the flake with nix flake show, and you will be prompted to update the paths attribute.
Add the action to your workflow:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: stainless-em/bootstrap-lix@main
- run: nix developThe action reads flake.nix and downloads and installs the referenced closure from cache.nixos.org.
pnpm installto fetch dependenciespnpm run buildto bundlesrc/index.tsintodist/index.jspnpm testto test bootstrapping in a Docker containerpnpm fmtto run prettier