unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Nix programs on path but not found
@ 2022-02-22 20:10 Stefan Baums
  2022-03-02 18:15 ` Gary Johnson
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Baums @ 2022-02-22 20:10 UTC (permalink / raw)
  To: help-guix

Dear all,

I am running Guix with EXWM. Prior to Guix, in Ubuntu, I used
~/.xinitrc to set some environment variables and run some startup
programs. Since this is apparently not read in Guix+EXWM, I put
the following at the top of my ~/.exwm instead:

   (setenv "PATH" (concat (getenv "PATH") ":/home/user/.nix-profile/bin"))
   (setq exec-path (append exec-path '("/home/user/.nix-profile/bin")))

followed by:

   (start-process "xinit" "xinit" "bash" "/home/user/.xinitrc")

After startup, in eshell I then get:

   ~ $ echo $PATH
   /run/setuid-programs:/home/user/.config/guix/current/bin:/home/user/.guix-profile/bin:/home/user/.guix-profile/sbin:/run/current-system/profile/bin:/run/current-system/profile/sbin:/gnu/store/0c1yfbxyv877mlgychfgvmk5ha2jqh52-gzip-1.10/bin:/gnu/store/8fpk2cja3f07xls48jfnpgrzrljpqivr-coreutils-8.32/bin:/home/user/.nix-profile/bin

and when I check the value of exec-path, it is:

   ("/run/setuid-programs" "/home/user/.config/guix/current/bin" "/home/user/.guix-profile/bin" "/home/user/.guix-profile/sbin" "/run/current-system/profile/bin" "/run/current-system/profile/sbin" "/gnu/store/0c1yfbxyv877mlgychfgvmk5ha2jqh52-gzip-1.10/bin" "/gnu/store/8fpk2cja3f07xls48jfnpgrzrljpqivr-coreutils-8.32/bin" "/gnu/store/955rbw95zj8g2a3ail5zf9ml7jzi4zr0-emacs-27.2/libexec/emacs/27.2/x86_64-pc-linux-gnu" "/home/user/.nix-profile/bin")

(both as expected).

From ansi-term and from async-shell-command, I am now also able to
run programs installed in my Nix profile (e.g., onboard), but NOT
from eshell (even though PATH is there shown as above), and NOT
from the .xinitrc invoked from my .exwm startup script.

Does anybody what is going on here, and how to fix it?

All best,
Stefan


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

* Re: Nix programs on path but not found
  2022-02-22 20:10 Nix programs on path but not found Stefan Baums
@ 2022-03-02 18:15 ` Gary Johnson
  0 siblings, 0 replies; 2+ messages in thread
From: Gary Johnson @ 2022-03-02 18:15 UTC (permalink / raw)
  To: Stefan Baums; +Cc: help-guix

Stefan Baums <baums@stefanbaums.com> writes:

> I am running Guix with EXWM. Prior to Guix, in Ubuntu, I used
> ~/.xinitrc to set some environment variables and run some startup
> programs. Since this is apparently not read in Guix+EXWM, I put
> the following at the top of my ~/.exwm instead:
>
> ...snip...
>
> From ansi-term and from async-shell-command, I am now also able to
> run programs installed in my Nix profile (e.g., onboard), but NOT
> from eshell (even though PATH is there shown as above), and NOT
> from the .xinitrc invoked from my .exwm startup script.
>
> Does anybody what is going on here, and how to fix it?

I'm not sure what is happening in your particular case, but I am also
using Guix with EXWM (and have been doing so for several years now).

What I do for setting up my environment is this:

1. Declare environment variables in ~/.bash_profile (source ~/.bashrc
   from here as well).

2. Declare aliases in ~/.bashrc.

3. Set up my X environment (with xsetroot, xset, setxkbmap, xrdb, etc.)
   in ~/.xsession. End the ~/.xsession file with "exwm" on the final
   line.

4. Put my Emacs configuration in ~/.emacs.d/init.el.

5. Put my EXWM configuration in ~/.exwm.

6. Put my eshell aliases in ~/.emacs.d/eshell/alias.

When I log in via Guix's graphical login prompt, each of the files I
listed above are executed in the order that I named them. All
environment variable settings from my ~/.bash_profile are inherited by
all shells (including eshell) in Emacs.

Have fun and happy hacking!
  Gary

-- 
GPG Key ID: 7BC158ED
Use `gpg --search-keys lambdatronic' to find me
Protect yourself from surveillance: https://emailselfdefense.fsf.org
=======================================================================
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Why is HTML email a security nightmare? See https://useplaintext.email/

Please avoid sending me MS-Office attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


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

end of thread, other threads:[~2022-03-02 18:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-22 20:10 Nix programs on path but not found Stefan Baums
2022-03-02 18:15 ` Gary Johnson

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).