programs/nix-search-tv: init

Create the programs/nix-search-tv module, with options to enable,
change settings, and television integration.

Co-authored-by: awwpotato <awwpotato@voidq.com>
This commit is contained in:
Cool-Game-Dev 2025-08-05 12:22:28 -05:00 committed by Austin Horstman
parent 28caf471a6
commit b7ee8deefc
4 changed files with 151 additions and 0 deletions

View file

@ -0,0 +1,39 @@
{ pkgs, ... }:
{
programs.nix-search-tv = {
enable = true;
settings = {
indexes = [
"home-manager"
"nixos"
"nixpkgs"
];
experimental = {
render_docs_indexed = {
nvf = "https://notashelf.github.io/nvf/options.html";
};
};
};
};
nmt.script = ''
assertFileExists home-files/.config/nix-search-tv/config.json
assertFileContent home-files/.config/nix-search-tv/config.json \
${pkgs.writeText "settings-expected" ''
{
"experimental": {
"render_docs_indexed": {
"nvf": "https://notashelf.github.io/nvf/options.html"
}
},
"indexes": [
"home-manager",
"nixos",
"nixpkgs"
]
}
''}
'';
}

View file

@ -0,0 +1,4 @@
{
nix-search-tv-basic-config = ./basic-config.nix;
nix-search-tv-television = ./television.nix;
}

View file

@ -0,0 +1,22 @@
{ lib, pkgs, ... }:
{
programs.television.enable = true;
programs.nix-search-tv.enable = true;
nmt.script = ''
assertFileExists home-files/.config/television/cable/nix-search-tv.toml
assertFileContent home-files/.config/television/cable/nix-search-tv.toml \
${pkgs.writeText "settings-expected" ''
[metadata]
description = "Search nix options and packages"
name = "nix-search-tv"
[preview]
command = "${lib.getExe pkgs.nix-search-tv} preview {}"
[source]
command = "${lib.getExe pkgs.nix-search-tv} print"
''}
'';
}