srid / nixci

Define and build CI for Nix projects anywhere; superceded by Omnix https://omnix.page/om/ci.html
GNU Affero General Public License v3.0
109 stars 5 forks source link

Support using local cache from nix-magic-cache #28

Closed ParetoOptimalDev closed 1 year ago

ParetoOptimalDev commented 1 year ago

I tried adding this in the flake:

nixConfig.binaryCaches = [ "http://127.0.0.1:37515/" ];

However that doesn't seem to be enough for nixci to use the binary cache there that nix-magic-cache creates.

This should also speed up builds since nix-magic-cache puts things in the github filesystem cache.

srid commented 1 year ago

nixci uses nix build ... under the hood, so shouldn't this already work?

ParetoOptimalDev commented 1 year ago

That's what I thought. Here is my github actions run:

https://github.com/ParetoOptimalDev/haskell-template2/actions/runs/6163342143/job/16726686449

My expected result was that I see substitutions from 127.0.0.1:37515 and "test build time after first run of..." would be around 2m rather than 4mlike the previous build in the actions list.

Here you can verify that nix-magic-cache added things: https://github.com/ParetoOptimalDev/haskell-template2/actions/runs/6163106293/job/16725946863#step:11:9

srid commented 1 year ago

I'm not too familiar with nix-magic-cache, but with nixci you can also pass nix arguments as follows (after the --):

nixci -- --extra-substituters 'http://localhost: 37515' --option require-sigs false 

Note: this is only available in master branch, and not released yet.

srid commented 1 year ago

I can't reproduce this in haskell-template https://github.com/srid/haskell-template/commit/f5f951186cc50f7f97c1398e992758b8b4bf56e3

https://github.com/srid/haskell-template/actions/runs/6164016293/job/16728821855

copying path '/nix/store/cxgikb3dxd0r53shd4w4v4vcayrgyi9n-haskell-template' from 'http://127.0.0.1:37515/'...