Cache miss on self-hosted CI

I have a self-hosted nix-serve-ng on my CI (Github Actions, which runs a nix build on each push).

On another hand, I have a flake.nix which starts with:

{
  nixConfig.extra-trusted-substituters = "https://nix.acme";
  nixConfig.extra-trusted-public-keys = "nix.acme:/kJVKDt...rc=";

...
    defaultPackage = haskelPackages.callCabal2nix ...

However, even though the CI run, I have to rebuild it locally on each nix build.

I have tried

nix-eval-jobs --check-cache-status --flake '.#defaultPackage' | jq -r '.'
warning: unknown setting 'allowed-users'                                       
warning: unknown setting 'trusted-users'                                       
warning: `--gc-roots-dir' not specified                                                                                                                       
Using saved setting for 'extra-trusted-public-keys = nix.acme:/kJVKDt...rc=' from ~/.local/share/nix/trusted-settings.json.
Using saved setting for 'extra-trusted-substituters = https://nix.acme' from ~/.local/share/nix/trusted-settings.json.
{                                                                              
  "attr": "x86_64-linux",                                                      
  "attrPath": [                                                                
    "x86_64-linux"                                                             
  ],                                                                           
  "drvPath": "/nix/store/wii...i-myproject-1.2.3.drv",
...
  },
  "isCached": false,
  "name": "myproject-1.2.3",
  "outputs": {
    "out": "/nix/store/i4i6qlh7r4...-myproject-1.2.3"
  },
  "system": "x86_64-linux"
}

Both paths exists on my CI (and nix build is mostly a no-op on it).

Is there anything I have to configure to have a cache it?

There may be an issue with trusted users if it’s using nix daemon service and that your user in the CI is not trusted, the flake can’t use the substituter.

I added this line in my /etc/nix/nix.conf:

trusted-users = @sudo github-runner

but it has no effect

I don’t know if it can have an impact, but nix-serve-ng is running as github-runner too

I have actually tried to run nix-serve-ng --verbose, it seems it is never hit.