mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-02 19:49:18 +00:00
Add an extraPackages option to the television module that wraps the `tv`
binary with additional packages in PATH. Defaults to fd, bat, and ripgrep
which are the dependencies required by television's default channels.
Existing tests updated to set extraPackages = [ ] since they test config
generation, not binary wrapping.
💘 Generated with Crush
Assisted-by: Crush:glm-5.2
58 lines
1.6 KiB
Nix
58 lines
1.6 KiB
Nix
{ pkgs, ... }:
|
|
{
|
|
programs.television = {
|
|
enable = true;
|
|
extraPackages = [ ];
|
|
settings = {
|
|
tick_rate = 50;
|
|
ui = {
|
|
use_nerd_font_icons = false;
|
|
show_preview_panel = true;
|
|
input_bar_position = "top";
|
|
};
|
|
};
|
|
channels.git-log = {
|
|
metadata = {
|
|
name = "git-log";
|
|
description = "A channel to select from git log entries";
|
|
requirements = [ "git" ];
|
|
};
|
|
source = {
|
|
command = "git log --oneline --date=short --pretty=\"format:%h %s %an %cd\" \"$@\"";
|
|
output = "{split: :0}";
|
|
};
|
|
preview = {
|
|
command = "git show -p --stat --pretty=fuller --color=always '{0}'";
|
|
};
|
|
};
|
|
};
|
|
|
|
nmt.script = ''
|
|
assertFileExists home-files/.config/television/config.toml
|
|
assertFileContent home-files/.config/television/config.toml \
|
|
${pkgs.writeText "settings-expected" ''
|
|
tick_rate = 50
|
|
|
|
[ui]
|
|
input_bar_position = "top"
|
|
show_preview_panel = true
|
|
use_nerd_font_icons = false
|
|
''}
|
|
assertFileExists home-files/.config/television/cable/git-log.toml
|
|
assertFileContent home-files/.config/television/cable/git-log.toml \
|
|
${pkgs.writeText "channels-expected" ''
|
|
[metadata]
|
|
description = "A channel to select from git log entries"
|
|
name = "git-log"
|
|
requirements = ["git"]
|
|
|
|
[preview]
|
|
command = "git show -p --stat --pretty=fuller --color=always '{0}'"
|
|
|
|
[source]
|
|
command = 'git log --oneline --date=short --pretty="format:%h %s %an %cd" "$@"'
|
|
output = "{split: :0}"
|
|
''}
|
|
'';
|
|
}
|