misc: fix defaultEditor option for HM and NixOS modules

This commit is contained in:
Gaetan Lepage 2023-09-18 23:45:50 +02:00 committed by Gaétan Lepage
parent 0ea5e205e6
commit 59232f22b5
2 changed files with 5 additions and 2 deletions

View file

@ -37,7 +37,8 @@ in {
xdg.configFile = files; xdg.configFile = files;
}) })
{ {
inherit (cfg) warnings assertions defaultEditor; inherit (cfg) warnings assertions;
home.sessionVariables = mkIf cfg.defaultEditor {EDITOR = "nvim";};
} }
]); ]);
} }

View file

@ -39,7 +39,9 @@ in {
environment.variables."VIM" = "/etc/nvim"; 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");
} }
]); ]);
} }