Allowing the configure_shell_profile function to make directories #13119
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
After installing Nix using the recommended method, I noticed that nix commands were not available in my shell.
Context
Similar to this issue i'm using Solus linux ( Solus-Budgie-Release-2025-01-26 ).
When configuring shells the
configure_shell_profile()
function will try to configure nix at several places :/etc/bashrc
/etc/profile.d/nix.sh
/etc/zshrc
/etc/bash.bashrc
/etc/zsh/zshrc
This has been added in the following commit by @abathur.
However, the code does not create directories if it's missing, it's assuming that
/etc/
/etc/profile.d/
and/etc/zsh/
exists.Unfortunately in Solus linux the
/etc/profile.d/
directory does not exist.It becomes a problem because solus linux's user
.bashrc
only source the/etc/profile
file.default
~/.bashrc
source /usr/share/defaults/etc/profile
The sourced file will source the
/etc/profile.d/
directory if it exists./usr/share/defaults/etc/profile
So to set up the shell of solus linux's user, the install script must create at least the
profile.d
directory.PS : I'm struggling to find a way to make test for this.
The test tool seems to automatically create
/outputs/out/etc/profile.d
before testing the install script.