Installable /etc/profile.d
activation scripts for use with flox
Users can define and install additional scripts in <env>/etc/profile.d
as
“custom packages”/installables to share common setup processes
across environments.
Recommended usage:
# flox.nix
{
packages.nixpkgs-flox.sqlite = {
meta.outputsToInstall = ["bin" "out" "dev"];
};
packages.nixpkgs-flox.pkg-config = {};
# Provides `<env>/etc/profile' base.
packages."github:flox/etc-profiles".etc-profiles = {};
shell.hook = ''
[[ -r "$FLOX_ENV/etc/profile" ]] && . "$FLOX_ENV/etc/profile";
pkg-config --list-all >&2;
'';
}
- profile-base is a simple script that will source child
scripts located in
<env>/etc/profile.d/*.sh
.- This script is required to run any scripts mentioned later
- profile-common-paths sets a small
set of the most commonly used UNIX
*PATH
variables.- This script is recommended as a member for all
profile.d
collections.
- This script is recommended as a member for all
- profile-python3 sets
PYTHONPATH
.- Only runs if
python3
is inPATH
, so it is a sane member of a robustprofile.d
collection.
- Only runs if
- profile-node sets
NODE_PATH
.- Only runs if
node
is inPATH
, so it is a sane member of a robustprofile.d
collection.
- Only runs if