From dceda0af627381bcf8d134daec25fc385c10e1e7 Mon Sep 17 00:00:00 2001 From: Devin Finlinson Date: Sun, 3 Dec 2023 19:55:35 -0700 Subject: 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. --- modules/home-manager/bat.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 modules/home-manager/bat.nix (limited to 'modules') 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"; + }; + }; +} -- cgit v1.2.3