programs.helix: add defaultEditor (#4127)
This commit is contained in:
parent
9ce6977fe7
commit
50cb4d8a1e
|
@ -18,6 +18,15 @@ in {
|
|||
description = "The package to use for helix.";
|
||||
};
|
||||
|
||||
defaultEditor = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to configure <command>hx</command> as the default
|
||||
editor using the <envar>EDITOR</envar> environment variable.
|
||||
'';
|
||||
};
|
||||
|
||||
settings = mkOption {
|
||||
type = tomlFormat.type;
|
||||
default = { };
|
||||
|
@ -154,6 +163,8 @@ in {
|
|||
config = mkIf cfg.enable {
|
||||
home.packages = [ cfg.package ];
|
||||
|
||||
home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "hx"; };
|
||||
|
||||
xdg.configFile = let
|
||||
settings = {
|
||||
"helix/config.toml" = mkIf (cfg.settings != { }) {
|
||||
|
|
Loading…
Reference in a new issue