mirror of
https://github.com/nix-community/home-manager
synced 2024-11-16 16:19:44 +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.";
|
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 {
|
settings = mkOption {
|
||||||
type = tomlFormat.type;
|
type = tomlFormat.type;
|
||||||
default = { };
|
default = { };
|
||||||
|
@ -154,6 +163,8 @@ in {
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
home.packages = [ cfg.package ];
|
home.packages = [ cfg.package ];
|
||||||
|
|
||||||
|
home.sessionVariables = mkIf cfg.defaultEditor { EDITOR = "hx"; };
|
||||||
|
|
||||||
xdg.configFile = let
|
xdg.configFile = let
|
||||||
settings = {
|
settings = {
|
||||||
"helix/config.toml" = mkIf (cfg.settings != { }) {
|
"helix/config.toml" = mkIf (cfg.settings != { }) {
|
||||||
|
|
Loading…
Reference in a new issue