Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nix-eshell does not work #190

Open
happyboy2k opened this issue Jun 6, 2023 · 2 comments
Open

nix-eshell does not work #190

happyboy2k opened this issue Jun 6, 2023 · 2 comments

Comments

@happyboy2k
Copy link

happyboy2k commented Jun 6, 2023

Hello, I have a problem with the nix-eshell command. I cannot use the programs I defined in my .nix file.
It somehow does not update the environment variables.

 echo $PATH
/run/wrappers/bin:/home/user/.nix-profile/bin:/etc/profiles/per-user/user/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin

in  nix-eshell:
echo $PATH
/run/wrappers/bin:/home/user/.nix-profile/bin:/etc/profiles/per-user/user/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin

in nix-shell:
 echo $PATH
/run/wrappers/bin:/usr/bin:/usr/sbin:/nix/store/kbcrs84s1x8yd5bp1nq6q6ihda8nd2lp-bash-interactive-5.2-p15/bin:/nix/store/ywwjpdyhar4f3vcqf4qk77vrbr3vj5wl-patchelf-0.15.0/bin:/nix/store/ahkfdxq8mcpsb5kvdvgqr1wv8zjngbh4-coreutils-9.1/bin:/nix/store/4qrbfa42xyicny7vlgbbqxz07kcsjbx2-findutils-4.9.0/bin:/nix/store/6bcqajyagcc4s3azx0zqnb3rqxd7gdnv-diffutils-3.9/bin:/nix/store/gy82r5cf12hgkmhzifsyx3fp6cnf6j2l-gnused-4.9/bin:/nix/store/zrls4w5lxynqakh1jlrp03kg4bxzp9yi-gnugrep-3.7/bin:/nix/store/s3yl3l8na93v53k2cfsyz0jrb50bnk8n-gawk-5.2.1/bin:/nix/store/czy796d2241296bdy45w87cmaiig50zr-gnutar-1.34/bin:/nix/store/hdbb5ayyrz1b5hicbsb4am8vin0xxxg6-gzip-1.12/bin:/nix/store/hd573q7097cxj5q29pnc3z0rvakz7ga3-bzip2-1.0.8-bin/bin:/nix/store/nnis9ph3wj866bbs0lalbf22i5bq8yry-gnumake-4.4.1/bin:/nix/store/rhvbjmcfnkg8i2dxpzr114cp1ws7f667-bash-5.2-p15/bin:/nix/store/x4ckkjsxfl4ihl82v0bzsyxs4ay2d5b5-patch-2.7.6/bin:/nix/store/8xjzmhw6hgqmynb5f1v7aw2lvafij405-xz-5.4.3-bin/bin:/nix/store/lcjsmsxqwd4vkq2wj5mmbyjzny3i6k49-file-5.44/bin:/run/wrappers/bin:/home/user/.nix-profile/bin:/etc/profiles/per-user/user/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin

in nixos configuration:
programs.emacs.extraPackages = epkgs: [epkgs.nix-mode];

greetings

@RomeoV
Copy link

RomeoV commented Sep 22, 2023

I have a related problem.

My shell.nix file looks like this:

{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  buildInputs = [
    pkgs.python311  # You can change this to the desired Python version
    pkgs.poetry
  ];
}

However, running nix-shell or nix-eshell pointed at this file, and just pressing Ret when asked for an attribute, yields

nix-instantiate: Error: nix-instantiate shell.nix failed to produce any output

and the paths are not loaded.

Assigning the shell to an attribute and loading that also doesn't work.

I am on emacs 29.1 and on the latest commit of nix-mode.

EDIT: Okay I found out it is because I am accessing the file through TRAMP and essentially execute the local call-process nix-instantiate) so it doesn't find the file. I'll see if I can fix that.

@RomeoV
Copy link

RomeoV commented Sep 22, 2023

I made some progress by replacing several calls to call-process by process-file, which is essentially a drop-in replacement that also respects remote processes, and further running (add-to-list 'tramp-remote-path 'tramp-own-remote-path). However, it's still not fully working...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants