feat: add coding packages module (bruno, insomnia)
This commit is contained in:
60
home/base/secrets/cli-tools/television.nix
Normal file
60
home/base/secrets/cli-tools/television.nix
Normal file
@@ -0,0 +1,60 @@
|
||||
# Television — fuzzy finder with custom channels for tldr, git-diff, and git-log.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.base.cliTools.television;
|
||||
in {
|
||||
# Enabled by default — base modules are always-on.
|
||||
options.base.cliTools.television.enable = (mkEnableOption "enable television") // {default = true;};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
programs.television = {
|
||||
enable = true;
|
||||
channels = {
|
||||
tldr = {
|
||||
metadata = {
|
||||
description = "Browse TLDR pages";
|
||||
name = "tldr";
|
||||
requirements = ["tldr"];
|
||||
};
|
||||
preview = {
|
||||
command = "tldr '{}'";
|
||||
};
|
||||
source = {
|
||||
command = "tldr --list";
|
||||
};
|
||||
};
|
||||
git-diff = {
|
||||
metadata = {
|
||||
description = "A channel to select files from git diff commands";
|
||||
name = "git-diff";
|
||||
requirements = ["git"];
|
||||
};
|
||||
preview = {
|
||||
command = "git diff HEAD --color=always -- '{}'";
|
||||
};
|
||||
source = {
|
||||
command = "git diff --name-only HEAD";
|
||||
};
|
||||
};
|
||||
git-log = {
|
||||
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}";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user