nixos/prometheus: remove absolute path literals#511569
Conversation
b5d1e5d to
dcf326e
Compare
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/6768 |
dcf326e to
cf3e31d
Compare
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/remove-all-absolute-path-literals-from-nixpkgs/77245/1 |
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/remove-all-absolute-path-literals-from-nixpkgs/77245/13 |
| (lib.warn '' | ||
| ${logPrefix}: configuration file "${file}" is being copied to the nix-store. | ||
| If you would like to avoid that, please set enableConfigCheck to false. | ||
| '' (builtins.toFile (builtins.baseNameOf file) (builtins.readFile file))); |
There was a problem hiding this comment.
This change is... wild. It reads the entire file into the nix evaluator just to throw it away!
Pattern changes like this across the whole repo should be added to lib. Then we can see the impact of changing the implementation of that function in lib, especially for a full config.
There was a problem hiding this comment.
What do you think about the idea mentioned here?
https://discourse.nixos.org/t/remove-all-absolute-path-literals-from-nixpkgs/77245/13
Absolute path literals are not portable.
Nix complains about the changed lines if the option
lint-absolute-path-literalsis set towarn.lint-absolute-path-literalsOption Documentation:https://nix.dev/manual/nix/2.34/command-ref/conf-file.html#conf-lint-absolute-path-literals
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.