Issue description
substituteAll is a bash function and a Nix function in pkgs.
The bash function is bad because
- it takes variables from the environment, which is too easily affected, and often the definition of those values is through
mkDerivation arguments, in which case it is not clear that any relation exists between the definition and the usage.
- the variables tend to be hard to grep. For one, the @ signs are omitted anywhere but in the file
- this is a
--subst-var complaint as well
The Nix function is even worse. Nix has semi-structured data, so the expectations are a bit higher. Variables passed to the pkgs.substituteAll functions all get substituted into the file, right? ... WRONG! Those variables are poured carelessly into mkDerivation, which assigns special meaning to them, and even ignores and replaces some, like system.
Steps to reproduce
Technical details
substituteAll would be useful if it wasn't such a hack. Maybe something could be achieved with structuredAttrs, so that the variables aren't taken from the environment, but from a separate, safe, json file.
There's also this. Not sure if I want to know more about the horrors inside.
Issue description
substituteAllis a bash function and a Nix function inpkgs.The bash function is bad because
mkDerivationarguments, in which case it is not clear that any relation exists between the definition and the usage.--subst-varcomplaint as wellThe Nix function is even worse. Nix has semi-structured data, so the expectations are a bit higher. Variables passed to the
pkgs.substituteAllfunctions all get substituted into the file, right? ... WRONG! Those variables are poured carelessly intomkDerivation, which assigns special meaning to them, and even ignores and replaces some, likesystem.Steps to reproduce
hostPlatform.systeminnixos-generate-config#228133 (comment)Technical details
substituteAllwould be useful if it wasn't such a hack. Maybe something could be achieved with structuredAttrs, so that the variables aren't taken from the environment, but from a separate, safe, json file.There's also this. Not sure if I want to know more about the horrors inside.