Skip to content

nixos/prometheus: remove absolute path literals#511569

Merged
SuperSandro2000 merged 1 commit into
NixOS:masterfrom
ameertaweel:prometheus-remove-absolute-path-literals
Apr 23, 2026
Merged

nixos/prometheus: remove absolute path literals#511569
SuperSandro2000 merged 1 commit into
NixOS:masterfrom
ameertaweel:prometheus-remove-absolute-path-literals

Conversation

@ameertaweel
Copy link
Copy Markdown
Contributor

Absolute path literals are not portable.
Nix complains about the changed lines if the option lint-absolute-path-literals is set to warn.

lint-absolute-path-literals Option Documentation:
https://nix.dev/manual/nix/2.34/command-ref/conf-file.html#conf-lint-absolute-path-literals

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@ameertaweel ameertaweel requested a review from WilliButz April 19, 2026 21:31
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Apr 19, 2026
@ameertaweel ameertaweel force-pushed the prometheus-remove-absolute-path-literals branch from b5d1e5d to dcf326e Compare April 19, 2026 21:45
@nixos-discourse
Copy link
Copy Markdown

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

@ameertaweel ameertaweel force-pushed the prometheus-remove-absolute-path-literals branch from dcf326e to cf3e31d Compare April 20, 2026 07:01
Copy link
Copy Markdown
Contributor

@malikwirin malikwirin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Apr 20, 2026
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Apr 20, 2026
@SuperSandro2000 SuperSandro2000 added this pull request to the merge queue Apr 23, 2026
Merged via the queue into NixOS:master with commit f368a8f Apr 23, 2026
33 of 35 checks passed
@ameertaweel ameertaweel deleted the prometheus-remove-absolute-path-literals branch April 24, 2026 22:02
@nixos-discourse
Copy link
Copy Markdown

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

@nixos-discourse
Copy link
Copy Markdown

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)));
Copy link
Copy Markdown
Contributor

@eclairevoyant eclairevoyant May 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants