In ubuntu I could place something like

export EDITOR=vim

in my .bashrc file.

How do I do this in nixos?


The same thing should work in nixos, although variables such as EDITOR should probably go in .profile instead. .bashrc is IIRC only sourced for interactive shells so variables exported there won't be available in programs started from your desktop environment menu.

You could also set environment.variables.VARIABLE = "VALUE"; in configuration.nix but not really appropriate for personal variables such as EDITOR. (ofc. if you're the only user it doesn't really matter that much)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.