feat(wrapperModules.television): init#528
Conversation
BirdeeHub
left a comment
There was a problem hiding this comment.
Some improvements about the types of paths things can accept and some convenience things, but it looks good!
|
Thanks for the feedback! I made the adjustments based on your comments. |
|
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! |
|
oh I wasn't aware there is the extraPackages option. That was what I was looking for haha |
|
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 ^ this one |
: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) |
|
Thanks for merging it! |
Wrapper module for Television.
Not sure what is the best/recommended way to handle TOML, so I just imitated what other wrapper modules did.