bug#56661: EMACSLOADPATH not set when using Guix System + Guix Home + SLIM + Mate
On 2022-07-22 11:32, Maxime Devos wrote: > On 20-07-2022 19:47, Andrew Tropin wrote: > >> I'm not sure how your login/display manager works, but for X11 session >> sourcing ~/.profile from ~/.xsession should do the trick. > Me neither, and I don't particularly care. > > If this is something that needs to be done, shouldn't _Guix System_ > create that file by default, for the same reason that Guix System > creates a ~/.profile and ~/.bash_profile by default? I don't see why I > would have to do that myself. It's a tricky question, because it's a case on the edge of Home/System. From one point of view it should be handled by some home service, which will create a proper ~/.xsession or extend it and generic mechanism, from some display managers will automatically source it, but on the other hand maybe adjusting system services for other DMs, which doesn't work "out of the box" yet is a way to go. I don't have much experience with X11, and don't see a whole picture, so it's hard to tell which option is better. -- Best regards, Andrew Tropin signature.asc Description: PGP signature
bug#56661: EMACSLOADPATH not set when using Guix System + Guix Home + SLIM + Mate
On 20-07-2022 19:47, Andrew Tropin wrote: I'm not sure how your login/display manager works, but for X11 session sourcing ~/.profile from ~/.xsession should do the trick. Me neither, and I don't particularly care. If this is something that needs to be done, shouldn't _Guix System_ create that file by default, for the same reason that Guix System creates a ~/.profile and ~/.bash_profile by default? I don't see why I would have to do that myself. Greetings, Maxime OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature
bug#56661: EMACSLOADPATH not set when using Guix System + Guix Home + SLIM + Mate
On 2022-07-20 14:30, Maxime Devos wrote: > On 20-07-2022 14:08, Andrew Tropin wrote: >> Hi Maxime, >> >> According to the documentation to get all the environment variables set >> correctly you either need to manage your login shell with Guix Home or >> do additional configuration of your shell: >> https://guix.gnu.org/manual/devel/en/html_node/Configuring-the-Shell.html > > I am not using a login shell, though I suppose there might be one under > the hood somewhere (IIRC, and if it hasn't changed, some login managers > are wrapped in Guix System to insert a bash --login in-between). Even if > I am using a (non-login) shell, there's still an issue: if I start an > application via the graphical things, they don't get all the environment > variables (I tested this by opening a terminal that starts bash and > doing "echo $EMACSLOADPATH", but that a shell is used for the test seems > irrelevant here to me). > >> From what I see you manage bash with Guix Home, > I am not. I just keep the default ~/.bash_profile etc that a fresh Guix > System install gave me and the only reason bash_profile things appear in > the home configuration is because "guix home import" generated that. I'm > not managing anything, just keeping the defaults. You are ;) Declaring home-bash-service-type in home environment means that Guix Home will generate and install bash configurations, which means you are managing bash configurations with Guix Home. >> so according to the >> source code your bash_profile should look differently from what you've >> posted and must contain `source ~/.profile` in it: > > ~/.bash_profile does contain that line: > > # Set up the system, user profile, and related variables. > # /etc/profile will be sourced by bash automatically > # Set up the home environment profile. > if [ -f ~/.profile ]; then source ~/.profile; fi > > # Honor per-interactive-shell startup file > if [ -f ~/.bashrc ]; then source ~/.bashrc; fi > # Honor per-interactive-shell startup file > if [ -f ~/.bashrc ]; then . ~/.bashrc; fi You can remove your original bash_profile, because it's just duplicates last two lines, Guix Home adds the same content as skeletons provided during system installation and a little more. > > However, .bash_profile (the one from the local-file) does not: > > # Honor per-interactive-shell startup file > if [ -f ~/.bashrc ]; then . ~/.bashrc; fi > > >> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/home/services/shells.scm#n440 >> >> This line makes your login shell > > I am not using a login shell but a graphical environment -- the only > reason I actually use a shell at all is because I find it more > convenient to open a terminal and type "emacs" than to look in the > graphical desktop thingy for the Emacs icon. Also, I'm not finding Emacs > here even though in the previous installation of Guix System (GDM + Mate > IIRC, without Guix Home but with "guix install ...". Icedove isn't > appearing there either, though the browser is. > > I recall that it login shells were not necessary on Guix System + > ~/.guix-profile (without Guix Home), at least for the desktop > environment combination I used back then, though it was required on my > Debian system to do "bash --login". I can do "bash --login" on my Guix > System + Guix Home setup to start a login shell, but that would be a > regression. > I'm not sure how your login/display manager works, but for X11 session sourcing ~/.profile from ~/.xsession should do the trick. Put the following content to your ~/.xsession: --8<---cut here---start->8--- . ~/.profile --8<---cut here---end--->8--- Or add the following service to your home environment: --8<---cut here---start->8--- (simple-service 'xsession-init-file home-files-service-type `((".xsession" ,(plain-file "xsession" ". ~/.profile" --8<---cut here---end--->8--- >> source .profile, which sources >> setup-environment, which sources ~/.guix-home/profile/etc/profile, which >> sets EMACSLOADPATH. >> >> Additionally, I've built the home environment you provided and it >> contains the code I mentioned above. >> >> Make sure that ~/.bash_profile and ~/.guix-home/files/.bash_profile >> point to the same file in the store. > > antipode@antipode ~$ ls -l .bash_profile > lrwxrwxrwx 1 antipode users 56 19 jul 22:14 .bash_profile -> > /gnu/store/1cq87qf8zccxlnkjwifcyhawmxvy7wfw-bash_profile > > antipode@antipode ~$ ls -l ~/.guix-home/files/.bash_profile > lrwxrwxrwx 1 root root 56 1 jan 1970 > /home/antipode/.guix-home/files/.bash_profile -> > /gnu/store/1cq87qf8zccxlnkjwifcyhawmxvy7wfw-bash_profile > > They do. Also, shouldn't ~/.bash_profile point to > ~/.guix-home/files/.bash_profile instead of directly to the store, to be > more atomic (unrelated to #56661 though), like done for symlinks in /etc > in Guix System? No.
bug#56661: EMACSLOADPATH not set when using Guix System + Guix Home + SLIM + Mate
On 20-07-2022 14:08, Andrew Tropin wrote: Hi Maxime, According to the documentation to get all the environment variables set correctly you either need to manage your login shell with Guix Home or do additional configuration of your shell: https://guix.gnu.org/manual/devel/en/html_node/Configuring-the-Shell.html I am not using a login shell, though I suppose there might be one under the hood somewhere (IIRC, and if it hasn't changed, some login managers are wrapped in Guix System to insert a bash --login in-between). Even if I am using a (non-login) shell, there's still an issue: if I start an application via the graphical things, they don't get all the environment variables (I tested this by opening a terminal that starts bash and doing "echo $EMACSLOADPATH", but that a shell is used for the test seems irrelevant here to me). From what I see you manage bash with Guix Home, I am not. I just keep the default ~/.bash_profile etc that a fresh Guix System install gave me and the only reason bash_profile things appear in the home configuration is because "guix home import" generated that. I'm not managing anything, just keeping the defaults. so according to the source code your bash_profile should look differently from what you've posted and must contain `source ~/.profile` in it: ~/.bash_profile does contain that line: # Set up the system, user profile, and related variables. # /etc/profile will be sourced by bash automatically # Set up the home environment profile. if [ -f ~/.profile ]; then source ~/.profile; fi # Honor per-interactive-shell startup file if [ -f ~/.bashrc ]; then source ~/.bashrc; fi # Honor per-interactive-shell startup file if [ -f ~/.bashrc ]; then . ~/.bashrc; fi However, .bash_profile (the one from the local-file) does not: # Honor per-interactive-shell startup file if [ -f ~/.bashrc ]; then . ~/.bashrc; fi https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/home/services/shells.scm#n440 This line makes your login shell I am not using a login shell but a graphical environment -- the only reason I actually use a shell at all is because I find it more convenient to open a terminal and type "emacs" than to look in the graphical desktop thingy for the Emacs icon. Also, I'm not finding Emacs here even though in the previous installation of Guix System (GDM + Mate IIRC, without Guix Home but with "guix install ...". Icedove isn't appearing there either, though the browser is. I recall that it login shells were not necessary on Guix System + ~/.guix-profile (without Guix Home), at least for the desktop environment combination I used back then, though it was required on my Debian system to do "bash --login". I can do "bash --login" on my Guix System + Guix Home setup to start a login shell, but that would be a regression. source .profile, which sources setup-environment, which sources ~/.guix-home/profile/etc/profile, which sets EMACSLOADPATH. Additionally, I've built the home environment you provided and it contains the code I mentioned above. Make sure that ~/.bash_profile and ~/.guix-home/files/.bash_profile point to the same file in the store. antipode@antipode ~$ ls -l .bash_profile lrwxrwxrwx 1 antipode users 56 19 jul 22:14 .bash_profile -> /gnu/store/1cq87qf8zccxlnkjwifcyhawmxvy7wfw-bash_profile antipode@antipode ~$ ls -l ~/.guix-home/files/.bash_profile lrwxrwxrwx 1 root root 56 1 jan 1970 /home/antipode/.guix-home/files/.bash_profile -> /gnu/store/1cq87qf8zccxlnkjwifcyhawmxvy7wfw-bash_profile They do. Also, shouldn't ~/.bash_profile point to ~/.guix-home/files/.bash_profile instead of directly to the store, to be more atomic (unrelated to #56661 though), like done for symlinks in /etc in Guix System? Greetings, Maxime. OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature
bug#56661: EMACSLOADPATH not set when using Guix System + Guix Home + SLIM + Mate
On 2022-07-20 12:45, Maxime Devos wrote: > Hi, > > (the SLIM + Mate might be irrelevant, untested) > > I am using Guix System and Guix Home. In Guix Home, I've added the > "emacs" and "emacs-magit" packages (and some others): > >> (home-environment >> (packages >> (specifications->packages >> (list "git" "irssi" "evolution" "openssh" "gnupg" "htop" >> "bash" "coreutils" "bash-completion" >> "emacs" "emacs-magit" "emacs-paredit" >> "icedove" "gnunet" "seahorse" #;"icedove-wayland"))) >> (services >> (list (service >> home-bash-service-type >> (home-bash-configuration >> (aliases >> '(("grep" . "grep --color=auto") >> ("ll" . "ls -l") >> ("ls" . "ls -p --color=auto"))) >> (bashrc >> (list (local-file ".bashrc" "bashrc"))) >> (bash-profile >> (list (local-file >> ".bash_profile" >> "bash_profile" > > For completeness, here is the .bash_profile and .bashrc (unmodified from > base installation, except for removing a redundant alias): > >> # Honor per-interactive-shell startup file >> if [ -f ~/.bashrc ]; then . ~/.bashrc; fi Hi Maxime, According to the documentation to get all the environment variables set correctly you either need to manage your login shell with Guix Home or do additional configuration of your shell: https://guix.gnu.org/manual/devel/en/html_node/Configuring-the-Shell.html From what I see you manage bash with Guix Home, so according to the source code your bash_profile should look differently from what you've posted and must contain `source ~/.profile` in it: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/home/services/shells.scm#n440 This line makes your login shell source .profile, which sources setup-environment, which sources ~/.guix-home/profile/etc/profile, which sets EMACSLOADPATH. Additionally, I've built the home environment you provided and it contains the code I mentioned above. Make sure that ~/.bash_profile and ~/.guix-home/files/.bash_profile point to the same file in the store. > > and > >> # Bash initialization for interactive non-login shells and >> # for remote shells (info "(bash) Bash Startup Files"). >> >> # Export 'SHELL' to child processes. Programs such as 'screen' >> # honor it and otherwise use /bin/sh. >> export SHELL >> >> if [[ $- != *i* ]] >> then >> # We are being invoked from a non-interactive shell. If this >> # is an SSH session (as in "ssh host command"), source >> # /etc/profile so we get PATH and other essential variables. >> [[ -n "$SSH_CLIENT" ]] && source /etc/profile >> >> # Don't do anything else. >> return >> fi >> >> # Source the system-wide file. >> source /etc/bashrc >> >> # Adjust the prompt depending on whether we're in 'guix environment'. >> if [ -n "$GUIX_ENVIRONMENT" ] >> then >> PS1='\u@\h \w [env]\$ ' >> else >> PS1='\u@\h \w\$ ' >> fi > > After a "guix home reconfigure" and after a few reboots, I tried out > emacs-magit, but there was no match for the "M-x magit-status". It > turned out that $EMACSLOADPATH was unset. However, it is set in > ~/.guix-home/profile/etc/profile: > >> # Source this file to define all the relevant environment variables in >> Bash >> # for this profile. You may want to define the 'GUIX_PROFILE' environment >> # variable to point to the "visible" name of the profile, like this: >> # >> # GUIX_PROFILE=/path/to/profile ; \ >> # source /path/to/profile/etc/profile >> # >> # When GUIX_PROFILE is undefined, the various environment variables refer >> # to this specific profile generation. >> >> export >> PATH="${GUIX_PROFILE:-/gnu/store/ll0p9k6yp5070svjhwry8dxdm98ipk7d-profile}/bin:${GUIX_PROFILE:-/gnu/store/ll0p9k6yp5070svjhwry> >> export >> GIT_EXEC_PATH="${GUIX_PROFILE:-/gnu/store/ll0p9k6yp5070svjhwry8dxdm98ipk7d-profile}/libexec/git-core" >> export >> BASH_LOADABLES_PATH="${GUIX_PROFILE:-/gnu/store/ll0p9k6yp5070svjhwry8dxdm98ipk7d-profile}/lib/bash${BASH_LOADABLES_PATH:+:}$BA> >> export >> INFOPATH="${GUIX_PROFILE:-/gnu/store/ll0p9k6yp5070svjhwry8dxdm98ipk7d-profile}/share/info${INFOPATH:+:}$INFOPATH" >> export >> EMACSLOADPATH="${GUIX_PROFILE:-/gnu/store/ll0p9k6yp5070svjhwry8dxdm98ipk7d-profile}/share/emacs/site-lisp${EMACSLOADPATH:+:}$E> >> export >> XDG_DATA_DIRS="${GUIX_PROFILE:-/gnu/store/ll0p9k6yp5070svjhwry8dxdm98ipk7d-profile}/share${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS" > > (nevermind the >, that's just me not making the terminal wide enough > before copying) > > Weirdly, EMACSLOADPATH is not set (tested in a terminal), but PATH, > GIT_EXEC_PATH, BASH_LOADABLES_PATH, INFOPATH and XDG_DATA_DIRS are set. > Also, inside a login shell (bash --login) (started inside the graphical > environment), EMACSLOADPATH is not set. > > Also, if I do "source ~/.guix-home/setup-environment", then >
bug#56661: EMACSLOADPATH not set when using Guix System + Guix Home + SLIM + Mate
Hi, (the SLIM + Mate might be irrelevant, untested) I am using Guix System and Guix Home. In Guix Home, I've added the "emacs" and "emacs-magit" packages (and some others): (home-environment (packages (specifications->packages (list "git" "irssi" "evolution" "openssh" "gnupg" "htop" "bash" "coreutils" "bash-completion" "emacs" "emacs-magit" "emacs-paredit" "icedove" "gnunet" "seahorse" #;"icedove-wayland"))) (services (list (service home-bash-service-type (home-bash-configuration (aliases '(("grep" . "grep --color=auto") ("ll" . "ls -l") ("ls" . "ls -p --color=auto"))) (bashrc (list (local-file ".bashrc" "bashrc"))) (bash-profile (list (local-file ".bash_profile" "bash_profile" For completeness, here is the .bash_profile and .bashrc (unmodified from base installation, except for removing a redundant alias): # Honor per-interactive-shell startup file if [ -f ~/.bashrc ]; then . ~/.bashrc; fi and # Bash initialization for interactive non-login shells and # for remote shells (info "(bash) Bash Startup Files"). # Export 'SHELL' to child processes. Programs such as 'screen' # honor it and otherwise use /bin/sh. export SHELL if [[ $- != *i* ]] then # We are being invoked from a non-interactive shell. If this # is an SSH session (as in "ssh host command"), source # /etc/profile so we get PATH and other essential variables. [[ -n "$SSH_CLIENT" ]] && source /etc/profile # Don't do anything else. return fi # Source the system-wide file. source /etc/bashrc # Adjust the prompt depending on whether we're in 'guix environment'. if [ -n "$GUIX_ENVIRONMENT" ] then PS1='\u@\h \w [env]\$ ' else PS1='\u@\h \w\$ ' fi After a "guix home reconfigure" and after a few reboots, I tried out emacs-magit, but there was no match for the "M-x magit-status". It turned out that $EMACSLOADPATH was unset. However, it is set in ~/.guix-home/profile/etc/profile: # Source this file to define all the relevant environment variables in Bash # for this profile. You may want to define the 'GUIX_PROFILE' environment # variable to point to the "visible" name of the profile, like this: # # GUIX_PROFILE=/path/to/profile ; \ # source /path/to/profile/etc/profile # # When GUIX_PROFILE is undefined, the various environment variables refer # to this specific profile generation. export PATH="${GUIX_PROFILE:-/gnu/store/ll0p9k6yp5070svjhwry8dxdm98ipk7d-profile}/bin:${GUIX_PROFILE:-/gnu/store/ll0p9k6yp5070svjhwry> export GIT_EXEC_PATH="${GUIX_PROFILE:-/gnu/store/ll0p9k6yp5070svjhwry8dxdm98ipk7d-profile}/libexec/git-core" export BASH_LOADABLES_PATH="${GUIX_PROFILE:-/gnu/store/ll0p9k6yp5070svjhwry8dxdm98ipk7d-profile}/lib/bash${BASH_LOADABLES_PATH:+:}$BA> export INFOPATH="${GUIX_PROFILE:-/gnu/store/ll0p9k6yp5070svjhwry8dxdm98ipk7d-profile}/share/info${INFOPATH:+:}$INFOPATH" export EMACSLOADPATH="${GUIX_PROFILE:-/gnu/store/ll0p9k6yp5070svjhwry8dxdm98ipk7d-profile}/share/emacs/site-lisp${EMACSLOADPATH:+:}$E> export XDG_DATA_DIRS="${GUIX_PROFILE:-/gnu/store/ll0p9k6yp5070svjhwry8dxdm98ipk7d-profile}/share${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS" (nevermind the >, that's just me not making the terminal wide enough before copying) Weirdly, EMACSLOADPATH is not set (tested in a terminal), but PATH, GIT_EXEC_PATH, BASH_LOADABLES_PATH, INFOPATH and XDG_DATA_DIRS are set. Also, inside a login shell (bash --login) (started inside the graphical environment), EMACSLOADPATH is not set. Also, if I do "source ~/.guix-home/setup-environment", then $EMACSLOADPATH" is set. TBI ... Greetings, Maxime. OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature