Skip to content

feat(wrapperModules.television): init#528

Merged
BirdeeHub merged 2 commits into
BirdeeHub:mainfrom
allen-liaoo:main
May 19, 2026
Merged

feat(wrapperModules.television): init#528
BirdeeHub merged 2 commits into
BirdeeHub:mainfrom
allen-liaoo:main

Conversation

@allen-liaoo
Copy link
Copy Markdown
Contributor

Wrapper module for Television.
Not sure what is the best/recommended way to handle TOML, so I just imitated what other wrapper modules did.

Copy link
Copy Markdown
Owner

@BirdeeHub BirdeeHub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some improvements about the types of paths things can accept and some convenience things, but it looks good!

Comment thread wrapperModules/t/television/module.nix Outdated
Comment thread wrapperModules/t/television/module.nix Outdated
Comment thread wrapperModules/t/television/module.nix Outdated
Comment thread wrapperModules/t/television/module.nix Outdated
Comment thread wrapperModules/t/television/module.nix
Comment thread wrapperModules/t/television/module.nix
Comment thread wrapperModules/t/television/module.nix Outdated
@allen-liaoo
Copy link
Copy Markdown
Contributor Author

Thanks for the feedback! I made the adjustments based on your comments.
An additional thing: Many channels need binaries to run correctly. Many community maintained channels requires bat, some requires rq, fd, etc. (See https://github.com/alexpasmantier/television/tree/main/cable/unix). Is the recommended way of getting these binaries for television be for the wrapper user themselve to wrap the wrapper package with these dependencies? Or should this module expose options to collect dependencies to wrap the package?

@BirdeeHub
Copy link
Copy Markdown
Owner

BirdeeHub commented May 18, 2026

It appears there is a potentially infinite number of channels that are possible.

It would be nice if we could parse the channel's TOML file and get the requirements automatically, but in the majority of cases that would be an IFD and the name in requirements may not match the name in nixpkgs. We don't have a great way of managing this without maintaining a list of possible channels and their dependencies as they are named in nixpkgs.

I think we should probably have people be just adding the required dependencies via config.extraPackages?

Let me run this and stuff, but it looks good, if it all works as expected, should be ready to merge!

@allen-liaoo
Copy link
Copy Markdown
Contributor Author

oh I wasn't aware there is the extraPackages option. That was what I was looking for haha
For testing, feel free to check out my working tv wrapper config: https://github.com/allen-liaoo/nix-packages/blob/master/wrappers/television.nix

@BirdeeHub
Copy link
Copy Markdown
Owner

BirdeeHub commented May 19, 2026

Also, fair warning, I am going to change it to runtimePkgs and accept more options (currently it only suffixes and I want people to be able to decide which happens per item)

It will mostly be a drop in replacement. It will be changed to a list of wlib.types.spec types, so that it accepts a list of either (just the packages, or a set with some options and the package). Will link the PR when I finish working on it, and then I will try this out.

There will be a deprecation warning and all that stuff too. I am very nearly done with it or I would review this before opening the PR haha

#539

^ this one

@BirdeeHub
Copy link
Copy Markdown
Owner

BirdeeHub commented May 19, 2026

:bl outputs.wrappers.television.wrap [
  { inherit pkgs; }
  ({ pkgs, lib, ... }: {
    channels.tldr = {
      metadata = { name = "tldr"; };
      source.command = "${lib.getExe pkgs.tldr} --list";
      preview.command = "${lib.getExe pkgs.tldr} '{}'";
      keybindings.ctrl-e = "actions:open";
      actions.open = {
        command = "${lib.getExe pkgs.tldr} '{}'";
        mode = "execute";
      };
    };
  })
]

^ seems to work just fine. LGTM

You can either put the paths directly, or include them via extraPackages (soon to be runtimePkgs)

@BirdeeHub BirdeeHub merged commit f318ea7 into BirdeeHub:main May 19, 2026
2 checks passed
@allen-liaoo
Copy link
Copy Markdown
Contributor Author

Thanks for merging it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants