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