2022-05-29 16:53:49 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
cfg = config.programs.micro;
|
|
|
|
|
|
|
|
jsonFormat = pkgs.formats.json { };
|
|
|
|
|
|
|
|
in {
|
|
|
|
meta.maintainers = [ hm.maintainers.mforster ];
|
|
|
|
|
|
|
|
options = {
|
|
|
|
programs.micro = {
|
2023-07-01 23:45:18 +00:00
|
|
|
enable = mkEnableOption "micro, a terminal-based text editor";
|
2022-05-29 16:53:49 +00:00
|
|
|
|
2024-07-28 21:00:57 +00:00
|
|
|
package = mkPackageOption pkgs "micro" { };
|
|
|
|
|
2022-05-29 16:53:49 +00:00
|
|
|
settings = mkOption {
|
|
|
|
type = jsonFormat.type;
|
|
|
|
default = { };
|
|
|
|
example = literalExpression ''
|
|
|
|
{
|
|
|
|
autosu = false;
|
|
|
|
cursorline = false;
|
|
|
|
}
|
|
|
|
'';
|
2023-07-01 23:45:18 +00:00
|
|
|
description = ''
|
2022-05-29 16:53:49 +00:00
|
|
|
Configuration written to
|
2023-06-30 23:30:13 +00:00
|
|
|
{file}`$XDG_CONFIG_HOME/micro/settings.json`. See
|
|
|
|
<https://github.com/zyedidia/micro/blob/master/runtime/help/options.md>
|
2022-05-29 16:53:49 +00:00
|
|
|
for supported values.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
2024-07-28 21:00:57 +00:00
|
|
|
home.packages = [ cfg.package ];
|
2022-05-29 16:53:49 +00:00
|
|
|
|
|
|
|
xdg.configFile."micro/settings.json".source =
|
|
|
|
jsonFormat.generate "micro-settings" cfg.settings;
|
|
|
|
};
|
|
|
|
}
|