Hello everyone,
Today, while optimizing the closure size of a Home-Manager profile, I discovered that including Python3 significantly increased the size. Specifically, Python3 set the fish
derivation’s size to 220MB.
❯ nix path-info --recursive --size --closure-size --human-readable /nix/store/rswmlkz46y7svb399kfzvp3gdihml8mg-fish-3.7.1
...
/nix/store/rswmlkz46y7svb399kfzvp3gdihml8mg-fish-3.7.1 14.6M 220.8M
...
Upon examining the Fish derivation, I found a parameter usePython
set to true
by default.
programs.fish.package = pkgs.fish.override({
usePython = false;
});
When I rebuilt the profile with usePython
set to false
, its size dropped to 92MB.
❯ nix path-info --recursive --size --closure-size --human-readable /nix/store/7bg7lhhvbp5fmf75bkb6a3dcn8958r7a-pol-fish-completions -L --impure
...
/nix/store/mgmn7cyjriy65z27hijfma2habq4779y-fish-3.7.1 14.6M 92.3M
...
It appears that Python is primarily used to run fish_config
, the web-based interface for configuring Fish.
Given this, I opened this thread to discuss whether the usePython
flag should default to false
to optimize the closure size for users who do not require the web configuration interface. In this Nix context, Fish is usually configured through Home-Manager and/or custom config files. I guess not so many people are aware of this config interface anyway, but I might be wrong.
To fix this, we could for example use python
from the path if it is available. If it’s there it works, if not, just bails out with an error message.
Curious to hear your thoughts and suggestions on this matter,
Thanks!