juspay / omnix

🚧 A Nix wrapper to improve developer experience
https://omnix.page
GNU Affero General Public License v3.0
70 stars 5 forks source link

`om ci`: Support for `use`ing & `push`ing to cachix #197

Closed srid closed 3 weeks ago

srid commented 1 month ago

... 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.

https://github.com/juspay/omnix/blob/2aa1f48783b9757e87e9c54f5f250bb56384f066/nix/modules/cache-pins.nix#L41-L48

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

https://github.com/juspay/omnix/blob/2aa1f48783b9757e87e9c54f5f250bb56384f066/.github/workflows/ci.yaml#L19-L24

https://github.com/juspay/omnix/blob/2aa1f48783b9757e87e9c54f5f250bb56384f066/.github/workflows/ci.yaml#L70-L72

srid commented 1 month ago

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

srid commented 3 weeks ago

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 https://github.com/juspay/cachix-push/issues/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 commented 3 weeks ago

https://github.com/juspay/cachix-push/pull/7

Will document this as well.