guix-devel
[Top][All Lists]
Advanced

[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

Hi,

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-profile/etc/profile.

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/config.fish, and generate
configurations for user profile in ~/.guix-profile/etc/fish/config.fish.
Or generate configurations for system profile in
/run/current-system/profile/etc/fish/conf.d/00-guix-system.fish, and
generate configurations for user profile in
~/.guix-profile/etc/fish/conf.d/01-guix-user.fish.  If we choose the
former, we should remove etc/fish/config.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
https://fishshell.com/docs/current/index.html#initialization.

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

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

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

   etc/fish/config.fish does nothing by default.  It's left for system-wide fish
   configuration.  In patch #34003, I let it source /etc/fish/config.fish, so we
   can put system-wide configurations for guix in /etc/fish/config.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
   order.

   (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/config.fish
   This is XDG_CONFIG_HOME/fish/config.fish.
   Default: ~/.config/fish/config.fish.

--
Meiyo Peng
https://www.pengmeiyu.com/



reply via email to

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