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
gfortranlibreofficeetc. 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-serveimplementation I have tried was able to provide therealisationsendpoint to make a binary-cache useful (I have looked atnix-serve,nix-serve-ngandharmonia). 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-serverunning with therealisationsendpoint. 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 buildstill tried to rebuild everything, although the.drvfile, andoutpath are available on the binary-cache. Of course I also tried withssh-ngstore, butnix buildstill tried to rebuild everything. I suspect this is because the localnixdidn’t connect the derivation with the realisation of theoutpath. (I also tried copying theoutpath 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.