-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
texlive: replace deprecated texlive.combine with texlive.withPackages #9699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,10 +8,6 @@ let | |
| inherit (lib) mkOption types; | ||
|
|
||
| cfg = config.programs.texlive; | ||
|
|
||
| texlive = cfg.packageSet; | ||
| texlivePkgs = cfg.extraPackages texlive; | ||
|
|
||
| in | ||
| { | ||
| meta.maintainers = [ lib.maintainers.rycee ]; | ||
|
|
@@ -20,22 +16,22 @@ in | |
| programs.texlive = { | ||
| enable = lib.mkEnableOption "TeX Live"; | ||
|
|
||
| packageSet = mkOption { | ||
| default = pkgs.texlive; | ||
| defaultText = lib.literalExpression "pkgs.texlive"; | ||
| package = mkOption { | ||
| type = types.package; | ||
| default = pkgs.texliveSmall; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: retain the current default behavior Keeping |
||
| description = "TeX Live package set to use."; | ||
| }; | ||
|
|
||
| extraPackages = mkOption { | ||
| default = tpkgs: { inherit (tpkgs) collection-basic; }; | ||
| defaultText = "tpkgs: { inherit (tpkgs) collection-basic; }"; | ||
| default = _ps: [ ]; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. todo: cover the existing caller contract Keep a regression test where |
||
| defaultText = "_ps: [ ];"; | ||
| example = lib.literalExpression '' | ||
| tpkgs: { inherit (tpkgs) collection-fontsrecommended algorithms; } | ||
| ps: with ps; [ collection-fontsrecommended algorithms ]; | ||
| ''; | ||
| description = "Extra packages available to TeX Live."; | ||
| }; | ||
|
|
||
| package = mkOption { | ||
| finalPackage = mkOption { | ||
| type = types.package; | ||
| description = "Resulting customized TeX Live package."; | ||
| readOnly = true; | ||
|
|
@@ -44,15 +40,8 @@ in | |
| }; | ||
|
|
||
| config = lib.mkIf cfg.enable { | ||
| assertions = [ | ||
| { | ||
| assertion = texlivePkgs != { }; | ||
| message = "Must provide at least one extra package in" + " 'programs.texlive.extraPackages'."; | ||
| } | ||
| ]; | ||
|
|
||
| home.packages = [ cfg.package ]; | ||
| home.packages = [ cfg.finalPackage ]; | ||
|
|
||
| programs.texlive.package = texlive.combine texlivePkgs; | ||
| programs.texlive.finalPackage = cfg.package.withPackages cfg.extraPackages; | ||
| }; | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,34 @@ | ||
| { lib, pkgs, ... }: | ||
| { | ||
| config = { | ||
| programs.texlive.enable = true; | ||
| pkgs, | ||
| config, | ||
| ... | ||
| }: | ||
|
|
||
| # Set up a minimal mocked texlive package set. | ||
| nixpkgs.overlays = [ | ||
| (_self: _super: { | ||
| texlive = { | ||
| collection-basic = pkgs.writeTextDir "collection-basic" ""; | ||
| combine = | ||
| tpkgs: | ||
| pkgs.symlinkJoin { | ||
| name = "dummy-texlive-combine"; | ||
| paths = lib.attrValues tpkgs; | ||
| }; | ||
| }; | ||
| }) | ||
| ]; | ||
| let | ||
| inherit (config.lib.test) mkStubPackage; | ||
|
|
||
| nmt.script = '' | ||
| assertFileExists home-path/collection-basic | ||
| ''; | ||
| fakeTexliveSet = { | ||
| collection-basic = pkgs.writeTextDir "collection-basic" ""; | ||
| }; | ||
| in | ||
| { | ||
| programs.texlive = { | ||
| enable = true; | ||
| package = mkStubPackage { | ||
| name = "texlive"; | ||
| extraAttrs = { | ||
| withPackages = | ||
| tpkgs: | ||
| pkgs.symlinkJoin { | ||
| name = "dummy-texlive-combine"; | ||
| paths = tpkgs fakeTexliveSet; | ||
| }; | ||
| }; | ||
| }; | ||
| extraPackages = ps: with ps; [ collection-basic ]; | ||
| }; | ||
|
|
||
| nmt.script = '' | ||
| assertFileExists home-path/collection-basic | ||
| ''; | ||
| } |
There was a problem hiding this comment.
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-onlypackageresult, and the currentextraPackagescontract, then replace only the implementation:Please move the naming redesign into a separate change with a staged migration.