Skip to content

texlive: replace deprecated texlive.combine with texlive.withPackages - #9699

Open
misumisumi wants to merge 1 commit into
nix-community:masterfrom
misumisumi:fix/texlive
Open

texlive: replace deprecated texlive.combine with texlive.withPackages#9699
misumisumi wants to merge 1 commit into
nix-community:masterfrom
misumisumi:fix/texlive

Conversation

@misumisumi

@misumisumi misumisumi commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Description

Nixpkgs has deprecated texlive.combine (combined schemes), which will
be removed in 27.05. This adapts the Home Manager texlive module
accordingly.
https://github.com/NixOS/nixpkgs/blob/7828bcabbb70303fda1067e6c3b362532302b75f/pkgs/tools/typesetting/tex/texlive/default.nix#L629

Also, some option names have been changed to align with the notation used in other modules, improving overall configuration readability.

Checklist

  • Change is backwards compatible.

  • Code formatted with nix fmt or
    nix-shell -A dev --run treefmt.

  • Code tested through nix build .#test-all
    or a targeted nix run .#tests -- <pattern>.

  • Test cases updated/added. See example.

  • x ] Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.
    • Generate a news entry. See News
    • Basic tests added. See Tests
  • If this PR adds an exciting new feature or contains a breaking change.

    • Generate a news entry. See News

To match the conventions used in other modules, changed `packageSet` to `package` and `package` to `finalPackage`.
misumisumi pushed a commit to misumisumi/nixos-desktop-config that referenced this pull request Jul 26, 2026

@khaneliman khaneliman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

texlive.combine should be replaced, but this can be done without changing the module API or defaults. Suggested minimal compatible implementation is in the first inline comment; follow-up comments cover default behavior and regression testing.

packageSet = mkOption {
default = pkgs.texlive;
defaultText = lib.literalExpression "pkgs.texlive";
package = mkOption {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

issue (blocking): keep this deprecation fix API-compatible

No migration helper is needed here. Retain packageSet, the read-only package result, and the current extraPackages contract, then replace only the implementation:

programs.texlive.package = cfg.packageSet.withPackages (
  tpkgs: lib.attrValues (cfg.extraPackages tpkgs)
);

Please move the naming redesign into a separate change with a staged migration.

defaultText = lib.literalExpression "pkgs.texlive";
package = mkOption {
type = types.package;
default = pkgs.texliveSmall;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

suggestion: retain the current default behavior

Keeping packageSet = pkgs.texlive and the existing extraPackages default preserves the current collection-basic result. Remove the switch to pkgs.texliveSmall from this compatibility fix.

extraPackages = mkOption {
default = tpkgs: { inherit (tpkgs) collection-basic; };
defaultText = "tpkgs: { inherit (tpkgs) collection-basic; }";
default = _ps: [ ];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

todo: cover the existing caller contract

Keep a regression test where extraPackages returns an attribute set. The lib.attrValues bridge at the withPackages call site should make that existing configuration continue to evaluate.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants