
Use Systemd For Managing Per User Environment Variables
This is a proposed Change for Fedora Linux.
This document represents a proposed Change. As part of the Changes process, proposals are publicly announced in order to receive community feedback. This proposal will only be implemented if approved by the Fedora Engineering Steering Committee.
Rely on systemd’s systemd.environment-generator functionality for managing per-user environment variables (such as appending ~/local/.bin and ~/bin to an user’s $PATH) instead of individual shellrc scripts (~/.bashrc, ~/.zshrc etc).
Currently, Fedora relies on shellrc scripts (~/.bashrc, ~/.zshrc files) for modifying an user’s environment variables.
An example of such a case is appending ~/.local/bin and ~/bin directories to $PATH
Such shellrc scripts have only been packaged for the bash and zsh shells. (rpm -ql /etc/skel/{.bashrc,.zshrc} returns packages bash and zsh)
However, Fedora Linux also offers several alternative shells such as fish, nushell (nu), xonsh, dash etc, for which shellrc scripts have not been packaged.
This leads to a situation where an user might change their login shell and be unable to directly launch scripts and programs stored in ~/.local/bin and ~/bin
systemd provides a mechanism for applying environment variables to all user processes via systemd.environment-generator.
Creating simple drop-in file(s) in the /etc/skel/.config/environment.d/ directory is a simpler and much cleaner way for both managing environment variables for an user and for mitigating the $PATH environment variable propagation issue for alternative shells.
Although out of scope for this specific proposal, the broader goal will be to ultimately move as much cruft possible out of shellrc scripts scattered across the filesystem at different places and /etc/profile into environment-generators
Will be updated later.
This change simplifies per-user environment variable propagation and makes environment variable changes independant of an user’s default shell.
/etc/skel/.*rc files located in the bash and zsh packages, modifying them to either remove any environment variable modification parts or splitting those parts into separate subpackages.Search for any other packages that also modify environemt variables by shellrc scripts.
None.
Do you require ‘QA Blueprint’ support? N
Will be added later.
Cleaner shellrc files will ease management for users.
Will be updated later.
N/A (not a System Wide Change)
\nMoved per-user environment variable handling to systemd.environment-generator\n
Last edited by @alking 2026-03-10T16:54:13Z
Last edited by @alking 2026-03-10T16:54:13Z






