Skip to content

nixos/litellm: warn when stateDir is outside /var/lib#497027

Open
sebastianpetrovski wants to merge 2 commits intoNixOS:masterfrom
sebastianpetrovski:litellm-stateDir-warning
Open

nixos/litellm: warn when stateDir is outside /var/lib#497027
sebastianpetrovski wants to merge 2 commits intoNixOS:masterfrom
sebastianpetrovski:litellm-stateDir-warning

Conversation

@sebastianpetrovski
Copy link

Summary

The services.litellm module provisions state via systemd StateDirectory, which places state under /var/lib, while the module also exposes services.litellm.stateDir.

To reduce confusion and avoid common misconfigurations with DynamicUser = true, this adds:

  • clarification to the stateDir option documentation
  • a warning when stateDir is set outside /var/lib

Notes / follow-ups

Supporting arbitrary state paths would likely require a larger change (e.g. an option to disable DynamicUser and run as a persistent user, plus directory provisioning/ownership management).

Test plan

  • Evaluate a config with services.litellm.stateDir = /home/foo; and confirm a warning is emitted

🤖 Generated with eca

The module provisions state under /var/lib via systemd StateDirectory, so values outside /var/lib are typically not writable for the dynamic user. Add documentation and a warning.
@nixpkgs-ci nixpkgs-ci bot added 12.first-time contribution This PR is the author's first one; please be gentle! 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. 9.needs: reviewer This PR currently has no reviewers requested and needs attention. 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 Mar 5, 2026
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/` 9.needs: reviewer This PR currently has no reviewers requested and needs attention. 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.first-time contribution This PR is the author's first one; please be gentle!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant