mirror of
https://github.com/nix-community/home-manager
synced 2024-12-21 09:19:47 +01:00
programs.helix: add defaultEditor (#4127)
This commit is contained in:
parent
9ce6977fe7
commit
50cb4d8a1e
1 changed files with 11 additions and 0 deletions
|
@ -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