I'm on NixOS 15 and nix-shell v1.10. I use Zsh as my main shell now, and would like to use it in conjuction with Oh-My-Zsh within the nix-shell as well when I'm working in development environments built by a Nix expression.
If it helps, here is one of the Nix environments I have set up for a Rails project:
with import <nixpkgs> {}; {
cannyFreeRadicalEnv = stdenv.mkDerivation rec {
name = "canny-free-radical-env";
version = "0.1";
src = ./.;
buildInputs = [
stdenv
ruby_2_2_2
bundler_HEAD
zlib
postgresql94
sqlite
];
};
}
** Edit **
Running the command this way does not indicate in the CLI prompt that I'm in the nix-shell. Is there an easy way to detect this so that I can script it up quickly in my zshrc
?
Like --command , but executes the command in a non-interactive shell. This means (among other things) that if you hit Ctrl-C while the command is running, the shell exits.
Changing default shelldefaultUserShell = pkgs. zsh; then run nixos-rebuild switch and reboot your system.
nix is used as default file when importing directory. So if you write x = import ./some/directory; , then ./some/directory/default.
A Nix environment keeps track of references automatically, which allows unused packages to be garbage collected when no other package depends on them. At the cost of greater storage requirements, all upgrades in Nix are guaranteed to be both atomic and capable of efficient roll-back.
Open a shell using:
nix-shell . --command "zsh"
Thanks to the guys on the #nixos IRC channel for getting me a quick answer.
there is PR #545 opened recently which will address this
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With