texlive: replace deprecated texlive.combine with texlive.withPackages - #9699
texlive: replace deprecated texlive.combine with texlive.withPackages#9699misumisumi wants to merge 1 commit into
Conversation
To match the conventions used in other modules, changed `packageSet` to `package` and `package` to `finalPackage`.
khaneliman
left a comment
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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: [ ]; |
There was a problem hiding this comment.
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.
Description
Nixpkgs has deprecated
texlive.combine(combined schemes), which willbe 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 fmtornix-shell -A dev --run treefmt.Code tested through
nix build .#test-allor a targeted
nix run .#tests -- <pattern>.Test cases updated/added. See example.
x ] Commit messages are formatted like
See CONTRIBUTING for more information and recent commit messages for examples.
If this PR adds a new module
If this PR adds an exciting new feature or contains a breaking change.