unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Plan for fish shell in Guix.
@ 2019-01-07  9:25 Meiyo Peng
  2019-01-07 11:36 ` Ricardo Wurmus
  2019-01-21  8:32 ` Meiyo Peng
  0 siblings, 2 replies; 10+ messages in thread
From: Meiyo Peng @ 2019-01-07  9:25 UTC (permalink / raw)
  To: guix-devel

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/

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Plan for fish shell in Guix.
  2019-01-07  9:25 Plan for fish shell in Guix Meiyo Peng
@ 2019-01-07 11:36 ` Ricardo Wurmus
  2019-01-07 11:45   ` Gábor Boskovits
  2019-01-21  8:32 ` Meiyo Peng
  1 sibling, 1 reply; 10+ messages in thread
From: Ricardo Wurmus @ 2019-01-07 11:36 UTC (permalink / raw)
  To: Meiyo Peng; +Cc: guix-devel


Hi,

> I plan to make Guix more friendly for fish shell, so that users can set
> fish shell as their login shell.

Thank you for taking the initiative.

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

This seems inelegant.  It is better to generate a file that can be read
by Fish.

-- 
Ricardo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Plan for fish shell in Guix.
  2019-01-07 11:36 ` Ricardo Wurmus
@ 2019-01-07 11:45   ` Gábor Boskovits
  2019-01-07 12:04     ` zimoun
  0 siblings, 1 reply; 10+ messages in thread
From: Gábor Boskovits @ 2019-01-07 11:45 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: Guix-devel

Hello,

this seems to be one of the problem points that comes around again and again.

Ricardo Wurmus <rekado@elephly.net> ezt írta (időpont: 2019. jan. 7., H, 12:37):
>
>
> Hi,
>
> > I plan to make Guix more friendly for fish shell, so that users can set
> > fish shell as their login shell.
>
> Thank you for taking the initiative.

Yes, thank you.

There is also a problem that often manifest on Debian and derivatives,
where /bin/sh is dash, as
some parts of the current generated script, and also some of our hints
imply bash.

Another problem on Debian like systems, is that the startup scripts
are ran in a distribution specific manner,
so for example the XDG_DATA_DIR environment should be set up in
.xsessionrc, as that is the only startup
script running on GUI session initialization... I guess there might be
other distro specific problems.

It might be worthy to have a look at other shells too, have a list
which ones are supported, or how could support be improved.

Best regards,
g_bor

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Plan for fish shell in Guix.
  2019-01-07 11:45   ` Gábor Boskovits
@ 2019-01-07 12:04     ` zimoun
  0 siblings, 0 replies; 10+ messages in thread
From: zimoun @ 2019-01-07 12:04 UTC (permalink / raw)
  To: Gábor Boskovits; +Cc: Guix-devel

Dear,

To complement, I am not sure that the manual is fully right about Bash
and `guix environment`.
https://lists.gnu.org/archive/html/help-guix/2019-01/msg00021.html
which is more or less the same kind of issue: interactive login shell
vs interactive non-login shell.

Thanks,
simon

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Plan for fish shell in Guix.
  2019-01-07  9:25 Plan for fish shell in Guix Meiyo Peng
  2019-01-07 11:36 ` Ricardo Wurmus
@ 2019-01-21  8:32 ` Meiyo Peng
  2019-01-21 20:57   ` John Soo
  2019-01-22  0:30   ` John Soo
  1 sibling, 2 replies; 10+ messages in thread
From: Meiyo Peng @ 2019-01-21  8:32 UTC (permalink / raw)
  To: guix-devel

Hello everyone,

Thank you for your patience.

I investigated the problem and chose to parse /etc/profile from fish
rather than generate separate configuration files for fish.  I think
this will make the Guix project easier to maintain in the future.

I looked NixOS's solution.  They choose this approach too, but their
patch is more complex.  I implemented my patch in a minimalistic manner.

The patch has been sent to guix-patches@gnu.org:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34153

I set fish as my login shell and every thing is working well.  Please
try the patch and report bugs if you are interested.

Thanks.


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Plan for fish shell in Guix.
  2019-01-21  8:32 ` Meiyo Peng
@ 2019-01-21 20:57   ` John Soo
  2019-01-22  0:52     ` Meiyo Peng
  2019-01-22  0:30   ` John Soo
  1 sibling, 1 reply; 10+ messages in thread
From: John Soo @ 2019-01-21 20:57 UTC (permalink / raw)
  To: Meiyo Peng; +Cc: guix-devel

Hi,

I’m trying it now. Everything seems to work pretty well! Thanks so much! This has been one major issue for me for a while!

- John

> On Jan 21, 2019, at 12:32 AM, Meiyo Peng <meiyo@disroot.org> wrote:
> 
> Hello everyone,
> 
> Thank you for your patience.
> 
> I investigated the problem and chose to parse /etc/profile from fish
> rather than generate separate configuration files for fish.  I think
> this will make the Guix project easier to maintain in the future.
> 
> I looked NixOS's solution.  They choose this approach too, but their
> patch is more complex.  I implemented my patch in a minimalistic manner.
> 
> The patch has been sent to guix-patches@gnu.org:
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34153
> 
> I set fish as my login shell and every thing is working well.  Please
> try the patch and report bugs if you are interested.
> 
> Thanks.
> 
> 
> --
> Meiyo Peng
> https://www.pengmeiyu.com/
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Plan for fish shell in Guix.
  2019-01-21  8:32 ` Meiyo Peng
  2019-01-21 20:57   ` John Soo
@ 2019-01-22  0:30   ` John Soo
  2019-01-22  1:24     ` Meiyo Peng
  1 sibling, 1 reply; 10+ messages in thread
From: John Soo @ 2019-01-22  0:30 UTC (permalink / raw)
  To: Meiyo Peng; +Cc: guix-devel

Hello,

I just have one issue with the patch so far:  I can’t seem to unset an abbreviation. An old configuration file seems to be “sticking” around for lack of better term. Otherwise, good stuff!

John

> On Jan 21, 2019, at 12:32 AM, Meiyo Peng <meiyo@disroot.org> wrote:
> 
> Hello everyone,
> 
> Thank you for your patience.
> 
> I investigated the problem and chose to parse /etc/profile from fish
> rather than generate separate configuration files for fish.  I think
> this will make the Guix project easier to maintain in the future.
> 
> I looked NixOS's solution.  They choose this approach too, but their
> patch is more complex.  I implemented my patch in a minimalistic manner.
> 
> The patch has been sent to guix-patches@gnu.org:
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34153
> 
> I set fish as my login shell and every thing is working well.  Please
> try the patch and report bugs if you are interested.
> 
> Thanks.
> 
> 
> --
> Meiyo Peng
> https://www.pengmeiyu.com/
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Plan for fish shell in Guix.
  2019-01-21 20:57   ` John Soo
@ 2019-01-22  0:52     ` Meiyo Peng
  0 siblings, 0 replies; 10+ messages in thread
From: Meiyo Peng @ 2019-01-22  0:52 UTC (permalink / raw)
  To: John Soo; +Cc: guix-devel

Hi John,

John Soo writes:

> I’m trying it now. Everything seems to work pretty well! Thanks so
> much! This has been one major issue for me for a while!

Thank you for your feedback.  I'm glad you like it.


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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Plan for fish shell in Guix.
  2019-01-22  0:30   ` John Soo
@ 2019-01-22  1:24     ` Meiyo Peng
  2019-01-22  2:22       ` John Soo
  0 siblings, 1 reply; 10+ messages in thread
From: Meiyo Peng @ 2019-01-22  1:24 UTC (permalink / raw)
  To: John Soo; +Cc: guix-devel

Hi John,

John Soo writes:

> I just have one issue with the patch so far: I can’t seem to unset an
> abbreviation. An old configuration file seems to be “sticking” around
> for lack of better term. Otherwise, good stuff!

This is most likely caused by the transition from fish 2.7 to fish 3.0.
Fish 3.0 automatically migrates your abbreviations to a new storage
format.  Please have a look at the man page of `abbr`.  You should now
manage you abbreviations with:

#+begin_SRC sh
  abbr --show
  abbr --add ec emacsclient
  abbr --erase ec
#+end_SRC

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

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: Plan for fish shell in Guix.
  2019-01-22  1:24     ` Meiyo Peng
@ 2019-01-22  2:22       ` John Soo
  0 siblings, 0 replies; 10+ messages in thread
From: John Soo @ 2019-01-22  2:22 UTC (permalink / raw)
  To: Meiyo Peng; +Cc: guix-devel

Ah! Makes sense! I haven’t had a chance to use 3.0 yet! I’ll try that and see.

> On Jan 21, 2019, at 5:24 PM, Meiyo Peng <meiyo@disroot.org> wrote:
> 
> Hi John,
> 
> John Soo writes:
> 
>> I just have one issue with the patch so far: I can’t seem to unset an
>> abbreviation. An old configuration file seems to be “sticking” around
>> for lack of better term. Otherwise, good stuff!
> 
> This is most likely caused by the transition from fish 2.7 to fish 3.0.
> Fish 3.0 automatically migrates your abbreviations to a new storage
> format.  Please have a look at the man page of `abbr`.  You should now
> manage you abbreviations with:
> 
> #+begin_SRC sh
>  abbr --show
>  abbr --add ec emacsclient
>  abbr --erase ec
> #+end_SRC
> 
> --
> Meiyo Peng
> https://www.pengmeiyu.com/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-01-22  2:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-07  9:25 Plan for fish shell in Guix Meiyo Peng
2019-01-07 11:36 ` Ricardo Wurmus
2019-01-07 11:45   ` Gábor Boskovits
2019-01-07 12:04     ` zimoun
2019-01-21  8:32 ` Meiyo Peng
2019-01-21 20:57   ` John Soo
2019-01-22  0:52     ` Meiyo Peng
2019-01-22  0:30   ` John Soo
2019-01-22  1:24     ` Meiyo Peng
2019-01-22  2:22       ` John Soo

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).