summaryrefslogtreecommitdiff
path: root/modules/home-manager/bat.nix
diff options
context:
space:
mode:
authorDevin Finlinson <devin.finlinson@pm.me>2023-12-03 19:55:35 -0700
committerDevin Finlinson <devin.finlinson@pm.me>2023-12-03 19:55:35 -0700
commitdceda0af627381bcf8d134daec25fc385c10e1e7 (patch)
tree75f5cbd852e6ba5138eb6e8e0ecbf5c6ae5983ca /modules/home-manager/bat.nix
parent47d41c5f73eb0ee2758242919cbee9b4dbc21d8f (diff)
added bat config, changed broken theme sourcing from ryan4yin source
config to functional one for future reference, the issue raised this error: error: A definition for option `home-manager.users.defin.programs.bat.themes.catppuccin-mocha' is not of type `strings concatenated with "\n"'. the issue was that nix seemingly cannot turn an array {} into a string, and the config option required a string. Comparing against other imported themes, I found the readFile command, which has documentation specifying that it returns file contents as string, so I simply used that solution.
Diffstat (limited to 'modules/home-manager/bat.nix')
-rw-r--r--modules/home-manager/bat.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/home-manager/bat.nix b/modules/home-manager/bat.nix
new file mode 100644
index 0000000..5a9802e
--- /dev/null
+++ b/modules/home-manager/bat.nix
@@ -0,0 +1,13 @@
+{ catppuccin-bat, ...}: {
+ # a cat(1) clone with syntax highlighting and Git integration.
+ programs.bat = {
+ enable = true;
+ config = {
+ pager = "less -FR";
+ theme = "catppuccin-mocha";
+ };
+ themes = {
+ catppuccin-mocha = builtins.readFile "${catppuccin-bat}/Catppuccin-mocha.tmTheme";
+ };
+ };
+}