{ lib, ... }: { environment.variables = { EDITOR = lib.mkDefault (if builtins.hasAttr "SSH_CONNECTION" builtins.currentSystemEnvironment then "nvim" else "code"); }; }