mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-03 12:09:19 +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
46 lines
875 B
Nix
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"
|
|
'';
|
|
};
|
|
}
|