The cache is hosted at
https://nix.trev.zip and requires the trusted public key for verification.Single Flake Configuration
Add cache configuration to yourflake.nix using nixConfig:
flake.nix
How nixConfig works
How nixConfig works
The
nixConfig attribute in your flake is applied when you run commands like nix build, nix develop, or nix run. This configuration only affects commands run from this specific flake.Users of your flake will also benefit from this cache configuration automatically.System-Wide Configuration
Configure the cache for all Nix operations on your NixOS system:Home Manager Configuration
For home-manager users, add the cache configuration:home.nix
Multi-User Installation
On multi-user Nix installations (including NixOS), configure/etc/nix/nix.conf:
/etc/nix/nix.conf
Verification
Verify that packages are being pulled from the cache:Cache Information
Cache URL
https://nix.trev.zipPublic Key
trev:I39N/EsnHkvfmsbx8RUW+ia5dOzojTQNCTzKYij1chU=Update Frequency
Automatic on every repository update
Retention
All built packages are cached
Troubleshooting
Packages are still building from source
Packages are still building from source
- Verify the cache URL is correct in your configuration
- Check that the public key matches exactly
- Ensure you’ve restarted the Nix daemon or rebuilt your system
- Run
nix store ping --store https://nix.trev.zipto test connectivity
Permission denied when accessing cache
Permission denied when accessing cache
Use
trusted-substituters instead of extra-substituters in your system configuration. The trusted- prefix allows unprivileged users to use the cache.Cache is slow or timing out
Cache is slow or timing out
The cache server may be experiencing high load. You can temporarily disable it by removing it from your substituters list, though this will require building packages from source.
Alternative: Per-Command Cache
Use the cache for a single command without configuring it system-wide:This approach requires typing the full command each time. For regular use, configure the cache in your flake or system configuration instead.
