Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

om ci: Support for useing & pushing to cachix #197

Closed
srid opened this issue Aug 5, 2024 · 3 comments
Closed

om ci: Support for useing & pushing to cachix #197

srid opened this issue Aug 5, 2024 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@srid
Copy link
Member

srid commented Aug 5, 2024

... in addition to 'whitelist pushing' (via pins).

Basically replace this entire module via om.ci.default.<..> configuration, and have om ci take care of the rest as part its build.

perSystem = { self', ... }: {
# https://om.cachix.org will ensure that these paths are always
# available. The rest may be be GC'ed.
cache-pins.pathsToCache = {
cli = self'.packages.default;
nix-health = self'.packages.nix-health;
};
};

  • The design should be cache agnostic, while supporting cachix to begin with (in future, we can support attic and the like).

This will obviate the following two steps in CI, in addition to the aforementioned flake-module:

- uses: cachix/cachix-action@v14
if: github.ref == 'refs/heads/main'
with:
name: om
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
skipPush: true

- name: Push to cachix
if: github.ref == 'refs/heads/main'
run: nix --option system "${{ matrix.system }}" run .#cachix-push

@srid srid added the enhancement New feature or request label Aug 5, 2024
@srid srid added this to the v2 milestone Aug 5, 2024
@srid
Copy link
Member Author

srid commented Aug 12, 2024

Perhaps this should be decoupled and built on top of #198

@srid
Copy link
Member Author

srid commented Aug 22, 2024

I tried to implement it only to realize that it is not that simple. Also, we don't want to complicate omnix, when the user could simply use unix tools to achieve this. For example,

$ om ci run . | rg -e "-omnix-cli-\d+\.\d+\.\d+$" -e "-omnix-mdbook-site$"
/nix/store/ppnag6lacdlg8q3vz3avv6da942ffgqw-omnix-mdbook-site
/nix/store/whdiim2js86xq14qdyk4mxfsdgni6cnh-omnix-cli-0.1.0

$ om ci run . | rg -e "-omnix-cli-\d+\.\d+\.\d+$" -e "-omnix-mdbook-site$" | xargs cachix push om

But to implement pinning (which requires naming each path to be pinned), we'll do juspay/cachix-push#6 - after which the user can simply run the following in sequence:

$ om ci run .
$ nix run .#cachix-push

Keeping cache pushes off CI is good for another reason -- it makes no sense to do that when doing local CI.

@srid srid closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2024
@srid
Copy link
Member Author

srid commented Aug 22, 2024

juspay/cachix-push#7

Will document this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant