Nix develop –ignore-environment --keep doesnot work on Fedora + Nix

Hii , i am using fedora with nix pkg manager , and currently using nix develop –ignore-environment --keep . this cmd is for creating a development shell and it doesn’t include base os pkgs . but the problem is i keep getting this err on fedora.

/usr/libexec/grepconf.sh: line 5: grep: command not found
/usr/libexec/grepconf.sh: line 5: grep: command not found
/usr/libexec/grepconf.sh: line 5: grep: command not found
bash: tr: command not found...
Packages providing this file are:
'coreutils'
'coreutils-single'
bash: readlink: command not found...
Packages providing this file are:
'coreutils'
'coreutils-single'
bash: basename: command not found...
Packages providing this file are:
'coreutils'
'coreutils-single'

i tried in other os . and also modified .bashrc and its working on it but not on fedora.
similar issue i found here: `nix develop --ignore-environment` broken on Fedora + Nix - NixOS Discourse

If you changed the PATH then its not safe to do that in .bashrc, do it .bash_profile.
Becuase .bashrc is run for every shell, so you make changes PATH in a script that will take effect in subprocesses.

Have you read this script to see what it is doing and why it is failing to find grep?

Added bash, nix

yep , but that’s not the main problem , i have removed it earlier .

bash: tr: command not found...
Packages providing this file are:
'coreutils'
'coreutils-single'
bash: readlink: command not found...
Packages providing this file are:
'coreutils'
'coreutils-single'
bash: basename: command not found...
Packages providing this file are:
'coreutils'
'coreutils-single'

You seem to be running the script in an environment that is lacking all the basic command line tools. Have you asked on a nix forum/mailing-list for help?

I’m not a nix user so cannot help further.

na i don’t think its nix , because as i said earlier i tested the same thing on different os arch and ubuntu .
this is confusing . cant say the main cause of problem.
Thank you for the reply :slight_smile: .

Fedora installs grep and tr as a mandatory package, those errors are not a Fedora issue.

Please post following line of the script:

:sweat_smile: i deleted that now . btw this err as gone as i removed .

usr/libexec/grepconf.sh: line 5: grep: command not found
/usr/libexec/grepconf.sh: line 5: grep: command not found
/usr/libexec/grepconf.sh: line 5: grep: command not found

yep i know but same goes for arch and others , im not sure whose causing the problem , need to talk with some nix geeks.

Could the problem be selinux? From what I have heard nix doesn’t really work with selinux by default. How did you install nix?

The determinate nix installer claims to support selinux, so might be worth trying.

already using determinate nix installer

That file is part of the grep package and that modification may be undone on updates.

It is also likely just an indication of the problem, not the actual problem.

grep -qsi "^COLOR.*none" /etc/GREP_COLORS

would be the offending line of the script.

This sounds like a path issue with something that is being called as part of bash initialization. Based on reading the linked post I would start by looking at bash completion.

You may also want to look at starting bash with the norc or noprofile options.

um not sure , this not working. as you see grep is not the main cause , its just that its a depednecy in my .bashrc but you can see this is the main thing that i want to deal with:[quote=“holi odin, post:4, topic:128877, username:holiodin”]

bash: tr: command not found...
Packages providing this file are:
'coreutils'
'coreutils-single'
bash: readlink: command not found...
Packages providing this file are:
'coreutils'
'coreutils-single'
bash: basename: command not found...
Packages providing this file are:
'coreutils'
'coreutils-single'

[/quote]