From mboxrd@z Thu Jan 1 00:00:00 1970 From: Meiyo Peng Subject: Plan for fish shell in Guix. Date: Mon, 07 Jan 2019 17:25:56 +0800 Message-ID: <87imz0x1i3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([209.51.188.92]:42984) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggRAj-0000Fp-WB for guix-devel@gnu.org; Mon, 07 Jan 2019 04:26:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggRAh-0003hW-Tm for guix-devel@gnu.org; Mon, 07 Jan 2019 04:26:12 -0500 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]:41544) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggRAh-0003fu-6Q for guix-devel@gnu.org; Mon, 07 Jan 2019 04:26:11 -0500 Received: by mail-pf1-x431.google.com with SMTP id b7so21560106pfi.8 for ; Mon, 07 Jan 2019 01:26:10 -0800 (PST) Received: from dinosaur (144.34.217.65.16clouds.com. [144.34.217.65]) by smtp.gmail.com with ESMTPSA id f6sm97528207pfg.188.2019.01.07.01.26.07 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 07 Jan 2019 01:26:08 -0800 (PST) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org 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/