Skip to content

Conversation

@SandaruKasa
Copy link
Contributor

@SandaruKasa SandaruKasa commented Aug 8, 2025

Closes #224525.

The spec: https://specifications.freedesktop.org/basedir-spec/latest/

This PR introduces an xdg.directories.enable option, which automatically sets up the following environment variables:

  • $XDG_CACHE_HOME
  • $XDG_CONFIG_HOME
  • $XDG_DATA_HOME
  • $XDG_STATE_HOME

Their default values are taken from the spec, but can be overridden using config.xdg.directories.cache-home & so on.

Newbie question:

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.

Add a 👍 reaction to pull requests you find important.

@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: 1-10 This PR causes between 1 and 10 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/` 9.needs: reviewer This PR currently has no reviewers requested and needs attention. labels Aug 8, 2025
@SandaruKasa
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 432111
Commit: 48646a39daabd672ac66e74beb8403088d9ab5ab


x86_64-linux

⏩ 2 packages blacklisted:
  • nixos-install-tools
  • tests.nixos-functions.nixos-test
✅ 5 packages built:
  • tests.devShellTools.nixos
  • tests.testers.lycheeLinkCheck.network
  • tests.testers.nixosTest-example
  • tests.testers.runNixOSTest-example (tests.testers.runNixOSTest-extendNixOS)
  • tests.trivial-builders.references

Copy link
Member

@cafkafk cafkafk left a comment

Choose a reason for hiding this comment

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

Cool idea, I'm however wondering how controversial this change would be, or if it would be considered something that should just be done through home manager. I'm personally not sure where I land on that question, but I get the sense that it would be a good idea to get a slight amount of consensus, so that people aren't surprised this was done.

@nixpkgs-ci nixpkgs-ci bot removed the 9.needs: reviewer This PR currently has no reviewers requested and needs attention. label Aug 25, 2025
@SandaruKasa SandaruKasa requested a review from cafkafk September 9, 2025 10:33
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. and removed 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. labels Sep 9, 2025
@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Sep 11, 2025
@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Sep 11, 2025
Copy link
Member

@cafkafk cafkafk left a comment

Choose a reason for hiding this comment

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

Changed default from true to lib.versionAtLeast config.system.stateVersion "25.11"

This may be a good start, but I think it would also be wise to add this change to the release notes as well, just so people will know that this behavior was added.

@SandaruKasa
Copy link
Contributor Author

Changed default from true to lib.versionAtLeast config.system.stateVersion "25.11"

This may be a good start, but I think it would also be wise to add this change to the release notes as well, just so people will know that this behavior was added.

Done. Also rebased on top of master.

@SandaruKasa SandaruKasa requested a review from cafkafk October 23, 2025 19:16
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. labels Oct 23, 2025
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 8.has: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation labels Oct 23, 2025
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: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-nixos-tests This PR causes rebuilds for all NixOS tests and should normally target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Documentation: Set up XDG Base Directory environment variables

4 participants