home: add bat config

This commit is contained in:
Antoine Martin 2021-07-29 00:07:33 +02:00
parent 2718be6ac9
commit 270809ca25
7 changed files with 40 additions and 2 deletions

View file

@ -21,7 +21,6 @@
environment.systemPackages = with pkgs; [
# shell usage
bat
fd
ripgrep
sd

20
home/bat.nix Normal file
View file

@ -0,0 +1,20 @@
{ config, lib, ... }:
let
cfg = config.my.home.bat;
batTheme = config.my.theme.batTheme;
in
{
options.my.home.bat = with lib; {
enable = (mkEnableOption "bat code display tool") // { default = true; };
};
config = lib.mkIf cfg.enable {
programs.bat = {
enable = true;
config = {
theme = batTheme.name;
};
};
};
}

View file

@ -2,6 +2,7 @@
{
imports = [
./alacritty.nix
./bat.nix
./emacs.nix
./env.nix
./fish

10
home/themes/bat.nix Normal file
View file

@ -0,0 +1,10 @@
{ lib }:
with lib;
types.submodule {
options = {
name = mkOption {
type = types.str;
default = "";
};
};
}

View file

@ -7,6 +7,10 @@ let
type = import ./alacritty.nix { inherit lib; };
default = {};
};
batTheme = mkOption {
type = import ./bat.nix { inherit lib; };
default = {};
};
i3Theme = mkOption {
type = import ./i3.nix { inherit lib; };
default = {};

View file

@ -0,0 +1,3 @@
{
name = "Solarized (light)";
}

View file

@ -1,5 +1,6 @@
{
alacrittyTheme = import ./alacritty.nix;
batTheme = import ./bat.nix;
i3Theme = import ./i3.nix;
i3BarTheme = import ./i3bar.nix;
alacrittyTheme = import ./alacritty.nix;
}