- packages.nix: essential packages (jq, ripgrep, fd, htop, coreutils, lazygit, httpie, just, devenv, gcc, go, sqlite, sqlite-vec, nix-index, nix-update, progress, comma, fabric-ai, llm, basecamp, hyprpaper-random, libnotify, trash-cli, unzip, zip, yazi) - bat.nix: bat with nix-colors derived syntax theme - carapace.nix: multi-shell completion (fish, nushell, bash) - direnv.nix: automatic env loading with nix-direnv - eza.nix: modern ls with icons, git status, long format - lf.nix: terminal file manager with bat preview - zoxide.nix: smarter cd with fish and nushell integration - zellij-ps.nix: project session manager wrapping cli.zellij-ps
145 lines
4.8 KiB
Nix
145 lines
4.8 KiB
Nix
# Bat — cat replacement with nix-colors syntax highlighting theme.
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
with lib; let
|
|
cfg = config.base.cliTools.bat;
|
|
palette = config.colorScheme.palette;
|
|
in {
|
|
options.base.cliTools.bat.enable = mkEnableOption "enable bat with nix-colors theme";
|
|
|
|
config = mkIf cfg.enable {
|
|
programs.bat = {
|
|
enable = true;
|
|
config = {theme = "universal";};
|
|
themes = {
|
|
universal = {
|
|
src = pkgs.writeText "universal.tmTheme" ''
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>name</key>
|
|
<string>Universal (nix-colors)</string>
|
|
<key>settings</key>
|
|
<array>
|
|
<dict>
|
|
<key>settings</key>
|
|
<dict>
|
|
<key>background</key>
|
|
<string>#${palette.base00}</string>
|
|
<key>foreground</key>
|
|
<string>#${palette.base05}</string>
|
|
<key>caret</key>
|
|
<string>#${palette.base05}</string>
|
|
<key>selection</key>
|
|
<string>#${palette.base02}</string>
|
|
<key>selectionForeground</key>
|
|
<string>#${palette.base05}</string>
|
|
<key>lineHighlight</key>
|
|
<string>#${palette.base01}</string>
|
|
</dict>
|
|
</dict>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>Comment</string>
|
|
<key>scope</key>
|
|
<string>comment</string>
|
|
<key>settings</key>
|
|
<dict>
|
|
<key>foreground</key>
|
|
<string>#${palette.base03}</string>
|
|
<key>fontStyle</key>
|
|
<string>italic</string>
|
|
</dict>
|
|
</dict>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>String</string>
|
|
<key>scope</key>
|
|
<string>string</string>
|
|
<key>settings</key>
|
|
<dict>
|
|
<key>foreground</key>
|
|
<string>#${palette.base0A}</string>
|
|
</dict>
|
|
</dict>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>Number</string>
|
|
<key>scope</key>
|
|
<string>constant.numeric</string>
|
|
<key>settings</key>
|
|
<dict>
|
|
<key>foreground</key>
|
|
<string>#${palette.base0E}</string>
|
|
</dict>
|
|
</dict>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>Keyword</string>
|
|
<key>scope</key>
|
|
<string>keyword</string>
|
|
<key>settings</key>
|
|
<dict>
|
|
<key>foreground</key>
|
|
<string>#${palette.base08}</string>
|
|
</dict>
|
|
</dict>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>Function</string>
|
|
<key>scope</key>
|
|
<string>entity.name.function</string>
|
|
<key>settings</key>
|
|
<dict>
|
|
<key>foreground</key>
|
|
<string>#${palette.base0B}</string>
|
|
</dict>
|
|
</dict>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>Type</string>
|
|
<key>scope</key>
|
|
<string>entity.name.type, storage.type</string>
|
|
<key>settings</key>
|
|
<dict>
|
|
<key>foreground</key>
|
|
<string>#${palette.base0D}</string>
|
|
</dict>
|
|
</dict>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>Variable</string>
|
|
<key>scope</key>
|
|
<string>variable</string>
|
|
<key>settings</key>
|
|
<dict>
|
|
<key>foreground</key>
|
|
<string>#${palette.base05}</string>
|
|
</dict>
|
|
</dict>
|
|
<dict>
|
|
<key>name</key>
|
|
<string>Constant</string>
|
|
<key>scope</key>
|
|
<string>constant</string>
|
|
<key>settings</key>
|
|
<dict>
|
|
<key>foreground</key>
|
|
<string>#${palette.base0E}</string>
|
|
</dict>
|
|
</dict>
|
|
</array>
|
|
</dict>
|
|
</plist>
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
};
|
|
}
|