I’m trying to package LibreWolf - draft PR here.
Packaging for this is a bit weird, since it’s just a few patches and then policy/preferences on top of vanilla Firefox. It’d be more accurate to call it a distribution than a fork.
This means that most of the packaging effort ends up being in the wrapper - which supports modifying the policies and configuration set by nixpkgs, however requires those to be set as an attrset/string respectively.
Long story short, this means I’d like to do something like this:
-
fetchFromGitLab
the policy/configuration repository -
readFile
/importJSON
the files in the resulting derivation - Assign them to the appropriate inputs for the wrapper
Ofborg seems to not be able to build something like this though:
extraPrefs = builtins.readFile "${librewolf.extraLib}/librewolf.cfg";
My guess is that for nixpkgs, it is impossible to read strings from the nix store at evaluation time; presumably for some cloud-build or purity reason.
Is my suspicion correct? If so, what is the alternative? Change the Firefox wrapper to allow packages to set default contents like I currently do?