typstPackages: Use makeScope so that it has typical pkgset attrs
This commit is contained in:
@@ -22,7 +22,7 @@ Since **Typst Universe** does not provide a way to fetch a package with a specif
|
||||
```nix
|
||||
typst.withPackages.override
|
||||
(old: {
|
||||
typstPackages = old.typstPackages.extend (
|
||||
typstPackages = old.typstPackages.overrideScope (
|
||||
_: previous: {
|
||||
polylux_0_4_0 = previous.polylux_0_4_0.overrideAttrs (oldPolylux: {
|
||||
src = oldPolylux.src.overrideAttrs { outputHash = YourUpToDatePolyluxHash; };
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
{
|
||||
lib,
|
||||
callPackage,
|
||||
newScope,
|
||||
}:
|
||||
|
||||
let
|
||||
toPackageName = name: version: "${name}_${lib.replaceStrings [ "." ] [ "_" ] version}";
|
||||
in
|
||||
lib.makeExtensible (
|
||||
final:
|
||||
lib.makeScope newScope (
|
||||
self:
|
||||
lib.recurseIntoAttrs (
|
||||
lib.foldlAttrs (
|
||||
packageSet: pname: versionSet:
|
||||
@@ -16,7 +17,7 @@ lib.makeExtensible (
|
||||
subPackageSet: version: packageSpec:
|
||||
subPackageSet
|
||||
// {
|
||||
${toPackageName pname version} = callPackage (
|
||||
${toPackageName pname version} = self.callPackage (
|
||||
{
|
||||
lib,
|
||||
buildTypstPackage,
|
||||
@@ -32,7 +33,7 @@ lib.makeExtensible (
|
||||
};
|
||||
|
||||
typstDeps = builtins.filter (x: x != null) (
|
||||
lib.map (d: (lib.attrsets.attrByPath [ d ] null final)) packageSpec.typstDeps
|
||||
lib.map (d: (lib.attrsets.attrByPath [ d ] null self)) packageSpec.typstDeps
|
||||
);
|
||||
|
||||
meta = {
|
||||
@@ -46,7 +47,7 @@ lib.makeExtensible (
|
||||
}
|
||||
) { } versionSet)
|
||||
// {
|
||||
${pname} = final.${toPackageName pname (lib.last (lib.attrNames versionSet))};
|
||||
${pname} = self.${toPackageName pname (lib.last (lib.attrNames versionSet))};
|
||||
}
|
||||
) { } (lib.importTOML ./typst-packages-from-universe.toml)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user