Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,12 @@ jobs:

steps:
- uses: actions/checkout@v2
- uses: nixbuild/nix-quick-install-action@v26
- run: nix build
- uses: cachix/install-nix-action@v22
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v12
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should probably happen in the release workflow, so that it only caches new releases

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so that nix users are only getting stable releases, not a canary/nightly build, and I think this would also cache binaries for pull requests? I guess i'm not entirely sure how the cache works

Copy link
Copy Markdown
Contributor Author

@akirak akirak Nov 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cachix offers a decent amount of storage space for free (10 GiB at present), but if you want that level of control, it may be a good idea to use magit-nix-cache-action for CI.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on how this saves us CI time? we are using setup-beam for the elixir/erlang installation and already cache mix dependencies

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would save time on nix-build CI job I added in the previous PR. It's unnecessary if you don't intend to provide Nix packages from the flake. You are not using Nix to build the release assets, so the action would never accelerate your main workflow. Fro Nix, the action caches the Nix store, which saves time spent on rebuilding rebar3 with the latest Erlang every time.

with:
name: elixir-tools
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- run: nix build --accept-flake-config
- run: nix flake check --accept-flake-config
5 changes: 5 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
{
inputs = {nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";};

nixConfig = {
extra-substituters = [ "https://elixir-tools.cachix.org" ];
extra-trusted-public-keys = [ "elixir-tools.cachix.org-1:GfK9E139Ysi+YWeS1oNN9OaTfQjqpLwlBaz+/73tBjU=" ];
};

outputs = {
self,
nixpkgs,
Expand Down