about summary refs log tree commit diff
path: root/modules/bat.nix
blob: a95d67d5b9d147b38b3a4fec32a870ee53520c7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ config, lib, ... }:
with lib;
let
  cfg = config.nixfiles.modules.bat;
in
{
  options.nixfiles.modules.bat.enable = mkEnableOption "bat, an alternative to cat";

  config = mkIf cfg.enable {
    nixfiles.modules.common.shell.aliases = {
      baj = "bat --language=json --tabs 2";
      bay = "bat --language=yaml --tabs 2";
      bas = "bat --language=syslog";
      less = "bat";
    };

    hm.programs.bat = {
      enable = true;
      config = {
        style = "plain";
        tabs = "4";
        wrap = "never";
      };
    };
  };
}

Consider giving Nix/NixOS a try! <3