diff --git a/base/programs.nix b/base/programs.nix index d49535a..06191b2 100644 --- a/base/programs.nix +++ b/base/programs.nix @@ -21,7 +21,6 @@ environment.systemPackages = with pkgs; [ # shell usage - bat fd ripgrep sd diff --git a/home/bat.nix b/home/bat.nix new file mode 100644 index 0000000..6d496e8 --- /dev/null +++ b/home/bat.nix @@ -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; + }; + }; + }; +} diff --git a/home/default.nix b/home/default.nix index b383e47..6ab7e70 100644 --- a/home/default.nix +++ b/home/default.nix @@ -2,6 +2,7 @@ { imports = [ ./alacritty.nix + ./bat.nix ./emacs.nix ./env.nix ./fish diff --git a/home/themes/bat.nix b/home/themes/bat.nix new file mode 100644 index 0000000..5c14c5f --- /dev/null +++ b/home/themes/bat.nix @@ -0,0 +1,10 @@ +{ lib }: +with lib; +types.submodule { + options = { + name = mkOption { + type = types.str; + default = ""; + }; + }; +} diff --git a/home/themes/default.nix b/home/themes/default.nix index 6ce1d1a..96fc994 100644 --- a/home/themes/default.nix +++ b/home/themes/default.nix @@ -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 = {}; diff --git a/home/themes/solarizedLight/bat.nix b/home/themes/solarizedLight/bat.nix new file mode 100644 index 0000000..053f11c --- /dev/null +++ b/home/themes/solarizedLight/bat.nix @@ -0,0 +1,3 @@ +{ + name = "Solarized (light)"; +} diff --git a/home/themes/solarizedLight/default.nix b/home/themes/solarizedLight/default.nix index ed22ad4..01517b1 100644 --- a/home/themes/solarizedLight/default.nix +++ b/home/themes/solarizedLight/default.nix @@ -1,5 +1,6 @@ { + alacrittyTheme = import ./alacritty.nix; + batTheme = import ./bat.nix; i3Theme = import ./i3.nix; i3BarTheme = import ./i3bar.nix; - alacrittyTheme = import ./alacritty.nix; }