1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-15 23:59:45 +01:00
home-manager/modules/programs/micro.nix
Michael Forster 65bcfaccc5
micro: add module
This adds initial bare-bones support for the `micro` editor.
2022-06-24 19:19:11 +02:00

43 lines
977 B
Nix

{ config, lib, pkgs, ... }:
with lib;
let
cfg = config.programs.micro;
jsonFormat = pkgs.formats.json { };
in {
meta.maintainers = [ hm.maintainers.mforster ];
options = {
programs.micro = {
enable = mkEnableOption "micro, a terminal-based text editor";
settings = mkOption {
type = jsonFormat.type;
default = { };
example = literalExpression ''
{
autosu = false;
cursorline = false;
}
'';
description = ''
Configuration written to
<filename>$XDG_CONFIG_HOME/micro/settings.json</filename>. See
<link xlink:href="https://github.com/zyedidia/micro/blob/master/runtime/help/options.md"/>
for supported values.
'';
};
};
};
config = mkIf cfg.enable {
home.packages = [ pkgs.micro ];
xdg.configFile."micro/settings.json".source =
jsonFormat.generate "micro-settings" cfg.settings;
};
}