Files
home-manager/tests/modules/programs/television/extra-packages.nix
csanthiago 0992a29487 television: add extraPackages option with default dependencies
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
2026-07-11 15:00:36 -05:00

46 lines
875 B
Nix

{ pkgs, config, ... }:
let
televisionPackage = config.lib.test.mkStubPackage {
name = "television";
buildScript = ''
mkdir -p "$out/bin"
touch "$out/bin/tv"
chmod +x "$out/bin/tv"
'';
};
in
{
programs.television = {
enable = true;
package = televisionPackage;
extraPackages = with pkgs; [
fd
bat
ripgrep
];
};
test.stubs = {
fd = {
name = "fd";
};
bat = {
name = "bat";
};
ripgrep = {
name = "ripgrep";
};
};
nmt = {
description = "Check if the television binary is correctly wrapped with extraPackages in PATH";
script = ''
tvWrapper="$TESTED/home-path/bin/tv"
assertFileExists "$tvWrapper"
assertFileRegex "$tvWrapper" "fd"
assertFileRegex "$tvWrapper" "bat"
assertFileRegex "$tvWrapper" "ripgrep"
'';
};
}