I have tested config.contentAddressedByDefault = true;
in my flake based setup on three x86_64 machines last week and reverted again today. My experience was mixed:
- It actually worked! (yay)
- It took a long time to basically (re)build every package in my config. Stuff like
gfortran
libreoffice
etc. do take their time. - My deployment tools (
deploy-rs
) did not work with CA derivations due to the path being unknown during evaluation. I hacked together a fix to make it deploy (still WIP!, see Incompatibility with content-addressed derivations · Issue #164 · serokell/deploy-rs · GitHub) - I was hit repeatedly by build failures due to (probably unrelated) Nix bugs like Remote Building Experienence massively degraded since ~2-3 months or nix-build: requires non-existent output 'out' from input derivation · Issue #6572 · NixOS/nix · GitHub which slowed the rebuild
- No
nix-serve
implementation I have tried was able to provide therealisations
endpoint to make a binary-cache useful (I have looked atnix-serve
,nix-serve-ng
andharmonia
). I took a look at ca-derivations support by thufschmitt · Pull Request #21 · edolstra/nix-serve · GitHub, fixed the stale nixpkgs override (see GitHub - gador/nix-serve at pr-21) and managed to getnix-serve
running with therealisations
endpoint. This, however, didn’t really help because I either got hit by Content-addressed realisations can't always be registered · Issue #5220 · NixOS/nix · GitHub (due to different local and remote versions of the same package) ornix build
still tried to rebuild everything, although the.drv
file, andout
path are available on the binary-cache. Of course I also tried withssh-ng
store, butnix build
still tried to rebuild everything. I suspect this is because the localnix
didn’t connect the derivation with the realisation of theout
path. (I also tried copying theout
path to the local machine, but this resulted in the error messages with conflicting versions of the same package. No garbage-collecting helped there either)
So all in all I was really happy to see it worked, but in its current form I cannot use it in production.