nixos/modules/home-manager/editors/default.nix
2026-01-11 01:42:54 +00:00

29 lines
602 B
Nix
Executable file

{ lib
, config
, ...
}:
let
cfg = config.custom.editors;
in
{
imports = [
./helix.nix
];
options.custom.editors = {
defaultEditor = lib.mkOption {
type = lib.types.enum [ "helix" ];
default = null;
description = "Which editor to use as the default one. If set to null the default editor won't be set explicitly.";
};
};
config = lib.mkIf (cfg.defaultEditor != null) {
assertions = [
{ assertion = (config.custom.editors.${cfg.defaultEditor}.enable);
message = "Can't set an editor as the default if it is disabled.";
}
];
};
}