-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
Open
Labels
0.kind: bugSomething is brokenSomething is broken6.topic: best practicesDocumentation and discussion around best practices for Nixpkgs developmentDocumentation and discussion around best practices for Nixpkgs development6.topic: hygieneCleaning up and removing cruftCleaning up and removing cruft
Description
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
mkDerivationarguments, 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-varcomplaint as well
- this is a
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
0.kind: bugSomething is brokenSomething is broken6.topic: best practicesDocumentation and discussion around best practices for Nixpkgs developmentDocumentation and discussion around best practices for Nixpkgs development6.topic: hygieneCleaning up and removing cruftCleaning up and removing cruft