From 59232f22b5683ccd2cc6a48636bcc3db6dd1c16e Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 18 Sep 2023 23:45:50 +0200 Subject: [PATCH] misc: fix defaultEditor option for HM and NixOS modules --- wrappers/hm.nix | 3 ++- wrappers/nixos.nix | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wrappers/hm.nix b/wrappers/hm.nix index 443f1533..a10abdc9 100644 --- a/wrappers/hm.nix +++ b/wrappers/hm.nix @@ -37,7 +37,8 @@ in { xdg.configFile = files; }) { - inherit (cfg) warnings assertions defaultEditor; + inherit (cfg) warnings assertions; + home.sessionVariables = mkIf cfg.defaultEditor {EDITOR = "nvim";}; } ]); } diff --git a/wrappers/nixos.nix b/wrappers/nixos.nix index 1f672b7b..ec924f03 100644 --- a/wrappers/nixos.nix +++ b/wrappers/nixos.nix @@ -39,7 +39,9 @@ in { environment.variables."VIM" = "/etc/nvim"; }) { - inherit (cfg) warnings assertions defaultEditor; + inherit (cfg) warnings assertions; + programs.neovim.defaultEditor = cfg.defaultEditor; + environment.variables.EDITOR = mkIf cfg.defaultEditor (lib.mkOverride 900 "nvim"); } ]); }