[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Plan for fish shell in Guix.

From: Meiyo Peng
Subject: Plan for fish shell in Guix.
Date: Mon, 07 Jan 2019 17:25:56 +0800


I plan to make Guix more friendly for fish shell, so that users can set
fish shell as their login shell.  It's not possible to set fish shell as
login shell now in Guix because fish shell cannot load environment
variables from /run/current-system/profile/etc/profile and

Guix can generate /etc/profile, /run/current-system/profile/etc/profile
for bash, so I think it can do the same for fish.  I suggest we generate
configurations for system profile in
/run/current-system/profile/etc/fish/, and generate
configurations for user profile in ~/.guix-profile/etc/fish/
Or generate configurations for system profile in
/run/current-system/profile/etc/fish/conf.d/, and
generate configurations for user profile in
~/.guix-profile/etc/fish/conf.d/  If we choose the
former, we should remove etc/fish/ from the fish package to
avoid conflicts.  That file is empty by default and is left for
sysadmins to edit so there will be no big problem.

I will learn how Guix generates /etc/profile, /etc/environment,
/run/current-system/profile/etc/profile, ~/.guix-profile/etc/profile
when I have time.  Don't expect me to finish the work in one week.

As an alternative solution, we can also parse etc/profile from fish.  I
am not sure if this is easier.

Please reply to this email if you have any ideas.

To help other people work on the problem, the following paragraphs
introduce fish shell initialization process. Based on

1. $__fish_data_dir/
   Usually: /usr/share/fish/
   Guix: /gnu/store/*fish*/share/fish/

   This file is provided by fish and should not be changed.  It executes the
   following files.

2. $__fish_sysconf_dir/
   Usually: /etc/fish/
   Guix: /gnu/store/*fish*/etc/fish/

   etc/fish/ does nothing by default.  It's left for system-wide fish
   configuration.  In patch #34003, I let it source /etc/fish/, so we
   can put system-wide configurations for guix in /etc/fish/

3. Files ending in .fish, in the following directories.  If there are multiple
   files with the same name in these directories, only the first will be
   executed.  They are executed in order of their filename, sorted in a natural

   (1) $__fish_config_dir/conf.d
   This is XDG_CONFIG_HOME/fish/conf.d.
   Default: ~/.config/fish/conf.d

   (2) $__fish_sysconf_dir/conf.d
   Usually: /etc/fish/conf.d
   Guix: /gnu/store/*fish*/etc/fish/conf.d

   (3) $__extra_confdir
   Usually: /usr/share/fish/vendor_conf.d
   Guix: (After applying patch #34003)
   | ~/.guix-profile/etc/fish/conf.d                      |
   | /run/current-system/profile/etc/fish/conf.d          |
   | ~/.guix-profile/share/fish/vendor_conf.d             |
   | /run/current-system/profile/share/fish/vendor_conf.d |
   | /gnu/store/*fish*/share/fish/vendor_conf.d           |

4. $__fish_config_dir/
   This is XDG_CONFIG_HOME/fish/
   Default: ~/.config/fish/

Meiyo Peng

reply via email to

[Prev in Thread] Current Thread [Next in Thread]