Skip to content

television: add wrapper helper#438728

Merged
SuperSandro2000 merged 1 commit intoNixOS:masterfrom
RossSmyth:televisionWrap
Oct 21, 2025
Merged

television: add wrapper helper#438728
SuperSandro2000 merged 1 commit intoNixOS:masterfrom
RossSmyth:televisionWrap

Conversation

@RossSmyth
Copy link
Contributor

Things done

  1. makeWrapper -> makeBinaryWrapper
  2. strictDeps = true
  3. installManPage
  4. installShellCompletion
  5. Add "share" output
  6. Wrap program to inject the "cable-dir" argument so that the user doesn't have to download the cables
  7. Add withPkgs wrapper helper to bring television in line with other packages like python, hunspell, typst, and others.
  8. Add test for the wrapper
  9. Add a backwards compatible warning for the previous override-based package injection
  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Aug 30, 2025
@nix-owners nix-owners bot requested review from getchoo and louis-thevenet August 30, 2025 22:04
Copy link
Member

@louis-thevenet louis-thevenet left a comment

Choose a reason for hiding this comment

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

I tested it in my NixOS config, the wrapping works and I get the cables without needing to download them. But the man pages and the shell completions don't seem to get installed. I made a naive suggestion but I'm not sure this is the real issue.

@louis-thevenet
Copy link
Member

I would assume the completions to be in /nix/store/xxxx/share// but it seems to get install elsewhere due to the wrapping?

Copy link
Member

@getchoo getchoo left a comment

Choose a reason for hiding this comment

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

I'm on board with something like this to avoid full rebuilds for simply adding external programs to $PATH (and it's something I've actually been putting off for a while...😆), but the current implementation has a good few problems I think we need to sort out

@RossSmyth RossSmyth force-pushed the televisionWrap branch 3 times, most recently from 6712d86 to 876115c Compare August 31, 2025 22:16
@RossSmyth
Copy link
Contributor Author

I am poking at the checkPhase rn

@RossSmyth
Copy link
Contributor Author

Ok my findings are that if it is desired for tests to run, probably a nixos vm test needs to be created. The start is:

  preCheck = ''
    substituteInPlace tests/common/mod.rs \
      --replace-fail '"./target/debug/tv"' '"./target/${stdenv.hostPlatform.rust.cargoShortTarget}/${finalAttrs.buildType}/tv"'
  '';

then there are many failures with os error 13 due to a pty not being available. And most tests require a pty.

So in conclusion, I think disabling tests right now is a good idea.

@RossSmyth RossSmyth changed the title television: Refactor, add wrapper helper television: 0.13.2 -> 0.13.3, refactor, add wrapper helper Sep 1, 2025
@nixpkgs-ci nixpkgs-ci bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 5, 2025
@SuperSandro2000
Copy link
Member

Can you please rebase?

@RossSmyth
Copy link
Contributor Author

Rebased, deleted the second commit that bumps the version since that what the rebase was against.

@nixpkgs-ci nixpkgs-ci bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Oct 13, 2025
Copy link
Member

@getchoo getchoo left a comment

Choose a reason for hiding this comment

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

I'm pretty happy with this! The only suggestion I would have is to maybe keep some backwards compatibility with something like this:

assert
  (extraPackages == null)
  || lib.warn "Overriding television with the 'extraPackages' attribute is deprecated. Please use `television.withPackages (p: [ p.fd ...])` instead." true;

let
  television = rustPlatform.buildRustPackage { ... };
in

if extraPackages == null then television else television.withPackages (lib.const extraPackages)

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Oct 20, 2025
Copy link
Member

@louis-thevenet louis-thevenet left a comment

Choose a reason for hiding this comment

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

lgtm

@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Oct 20, 2025
@RossSmyth RossSmyth changed the title television: 0.13.2 -> 0.13.3, refactor, add wrapper helper television: add wrapper helper Oct 20, 2025
@RossSmyth
Copy link
Contributor Author

Alright the backwards compat is in

@SuperSandro2000 SuperSandro2000 added this pull request to the merge queue Oct 21, 2025
@nixpkgs-ci nixpkgs-ci bot added 12.approvals: 3+ This PR was reviewed and approved by three or more persons. and removed 12.approvals: 2 This PR was reviewed and approved by two persons. labels Oct 21, 2025
Merged via the queue into NixOS:master with commit 1f9b829 Oct 21, 2025
29 of 32 checks passed
@RossSmyth RossSmyth deleted the televisionWrap branch October 21, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 3+ This PR was reviewed and approved by three or more persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants