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:
parent
28caf471a6
commit
b7ee8deefc
4 changed files with 151 additions and 0 deletions
39
tests/modules/programs/nix-search-tv/basic-config.nix
Normal file
39
tests/modules/programs/nix-search-tv/basic-config.nix
Normal 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"
|
||||
]
|
||||
}
|
||||
''}
|
||||
'';
|
||||
}
|
||||
4
tests/modules/programs/nix-search-tv/default.nix
Normal file
4
tests/modules/programs/nix-search-tv/default.nix
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
nix-search-tv-basic-config = ./basic-config.nix;
|
||||
nix-search-tv-television = ./television.nix;
|
||||
}
|
||||
22
tests/modules/programs/nix-search-tv/television.nix
Normal file
22
tests/modules/programs/nix-search-tv/television.nix
Normal 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"
|
||||
''}
|
||||
'';
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue