From 50cb4d8a1ef1240a54074addf081bd96dbbcab12 Mon Sep 17 00:00:00 2001 From: Dany Marcoux Date: Wed, 21 Jun 2023 15:50:13 +0200 Subject: [PATCH] programs.helix: add defaultEditor (#4127) --- modules/programs/helix.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/programs/helix.nix b/modules/programs/helix.nix index a240a71b..1f3e6249 100644 --- a/modules/programs/helix.nix +++ b/modules/programs/helix.nix @@ -18,6 +18,15 @@ in { description = "The package to use for helix."; }; + defaultEditor = mkOption { + type = types.bool; + default = false; + description = '' + Whether to configure hx as the default + editor using the EDITOR 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 != { }) {