mirror of
https://github.com/nix-community/home-manager
synced 2024-11-14 00:47:12 +00:00
40 lines
696 B
Nix
40 lines
696 B
Nix
{ config, lib, pkgs, ... }:
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.programs.bat;
|
|
|
|
in
|
|
|
|
{
|
|
meta.maintainers = [ maintainers.marsam ];
|
|
|
|
options.programs.bat = {
|
|
enable = mkEnableOption "bat, a cat clone with wings";
|
|
|
|
config = mkOption {
|
|
type = types.attrsOf types.str;
|
|
default = {};
|
|
example = {
|
|
theme = "TwoDark";
|
|
pager = "less -FR";
|
|
};
|
|
description = ''
|
|
Bat configuration.
|
|
'';
|
|
};
|
|
|
|
};
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = [ pkgs.bat ];
|
|
|
|
xdg.configFile."bat/config" = mkIf (cfg.config != {}) {
|
|
text = concatStringsSep "\n" (
|
|
mapAttrsToList (n: v: ''--${n}="${v}"'') cfg.config
|
|
);
|
|
};
|
|
};
|
|
}
|