aboutsummaryrefslogtreecommitdiffstats
path: root/modules/tools/bat/default.nix
blob: d4590424cc0dfc6799e42ef9f535b4ab7d20d62e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{ config, lib, pkgs, ... }:

{
	options.tools.bat = {
		enable = lib.mkEnableOption "Enables bat.";
	};

	config = lib.mkIf config.tools.bat.enable {
		programs.bat.enable = true;
		programs.bat.config = {
			tabs = "4";
			theme = "custom-theme";
		};
		# shell.alias."cat" = "${pkgs.bat}/bin/bat -pp";
		# shell.alias."less" = "${pkgs.bat}/bin/bat --paging always";
		# home.sessionVariables."PAGER" = "${pkgs.bat}/bin/bat --paging always";
		xdg.configFile."bat/themes/custom-theme.tmTheme".source
			= config.scheme {
				template = builtins.readFile ./theme.mustache.tmTheme;
			};
	};
}