Skip to content

Commit 4872f76

Browse files
authored
Merge pull request #32 from NixOS/treewide-update
treewide update: update dependencies, remove typix override
2 parents e9855fa + d52f5f8 commit 4872f76

File tree

10 files changed

+325
-458
lines changed

10 files changed

+325
-458
lines changed

dev-shells/default.nix

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,13 @@ mapAttrs (system: pkgs: {
4646

4747
];
4848

49-
shellHook =
50-
''
51-
export NIXOSLOGO_SRC=$(git rev-parse --show-toplevel)/package-sets/python-packages/nixoslogo
52-
export NIXOS_ANNOTATIONS_FONT_FILE="${jura}/share/fonts/truetype/jura/Jura-Regular.ttf"
53-
export NIXOS_COLOR_PALETTE_FILE="${nixos-branding.nixos-color-palette}/colors.toml";
54-
export NIXOS_LOGOTYPE_FONT_FILE="${route159}/share/fonts/opentype/route159/Route159-Regular.otf"
55-
''
56-
+ checks.${system}.pre-commit-check.shellHook;
49+
shellHook = ''
50+
export NIXOSLOGO_SRC=$(git rev-parse --show-toplevel)/package-sets/python-packages/nixoslogo
51+
export NIXOS_ANNOTATIONS_FONT_FILE="${jura}/share/fonts/truetype/jura/Jura-Regular.ttf"
52+
export NIXOS_COLOR_PALETTE_FILE="${nixos-branding.nixos-color-palette}/colors.toml";
53+
export NIXOS_LOGOTYPE_FONT_FILE="${route159}/share/fonts/opentype/route159/Route159-Regular.otf"
54+
''
55+
+ checks.${system}.pre-commit-check.shellHook;
5756

5857
}
5958
) { };

flake.lock

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

overlays/add-typix-library/overlay.nix

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,6 @@ let
1111
composeManyExtensions
1212
;
1313

14-
inherit (lib.strings)
15-
versionOlder
16-
;
17-
18-
inherit (lib.trivial)
19-
warnIf
20-
;
21-
2214
in
2315

2416
composeManyExtensions [
@@ -27,108 +19,4 @@ composeManyExtensions [
2719
typix-lib = inputs.typix.lib.${final.stdenv.hostPlatform.system};
2820
})
2921

30-
(
31-
final: prev:
32-
33-
{
34-
typix-lib =
35-
let
36-
versionThreshold = "0.13.1";
37-
currentTypstVersion = final.typst.version;
38-
in
39-
prev.typix-lib.overrideScope (
40-
finalScope: prevScope:
41-
warnIf (versionOlder versionThreshold currentTypstVersion)
42-
''
43-
The current version of typst is ${currentTypstVersion} which is older than version ${versionThreshold}.
44-
This overlay was created because typst version ${versionThreshold} did not deterministically create PDF files.
45-
Specifically, certain color data in SVG files were not being embedded in the SVG file deterministically.
46-
Try removing this overlay and see if the NixOS Branding Guide can be built and then re-built deterministically.
47-
If it can, remove this overlay. If not, bump the version threshold.
48-
''
49-
{
50-
51-
qpdf = warnIf (versionOlder "12" prev.qpdf.version) ''
52-
Upstream qpdf has reached version 12. This override and the associated derivation definition can be removed.
53-
'' final.qpdf;
54-
55-
buildDeterministicTypstProject = finalScope.callPackage (
56-
{
57-
lib,
58-
mkTypstDerivation,
59-
ocamlPackages,
60-
qpdf,
61-
typstOptsFromArgs,
62-
}:
63-
args@{
64-
typstCompileCommand ? "typst compile",
65-
typstSource ? "main.typ",
66-
...
67-
}:
68-
let
69-
70-
inherit (lib.attrsets)
71-
removeAttrs
72-
;
73-
74-
inherit (lib.strings)
75-
escapeShellArg
76-
removeSuffix
77-
;
78-
79-
typstOptsString = args.typstOptsString or (typstOptsFromArgs args);
80-
81-
cleanedArgs = removeAttrs args [
82-
"typstCompileCommand"
83-
"typstOpts"
84-
"typstOptsString"
85-
"typstOutput"
86-
"typstSource"
87-
];
88-
89-
outfileName = "${removeSuffix ".typ" typstSource}";
90-
91-
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [
92-
ocamlPackages.cpdf
93-
qpdf
94-
];
95-
96-
in
97-
mkTypstDerivation (
98-
cleanedArgs
99-
// {
100-
inherit
101-
nativeBuildInputs
102-
;
103-
104-
buildPhaseTypstCommand =
105-
args.buildPhaseTypstCommand or ''
106-
${typstCompileCommand} \
107-
${typstOptsString} \
108-
${escapeShellArg typstSource} \
109-
${outfileName}-compile.pdf
110-
111-
# need to remove the trailer ID so it can be recreated deterministically
112-
cpdf \
113-
-i ${outfileName}-compile.pdf \
114-
-remove-id \
115-
-o ${outfileName}-no-meta.pdf
116-
117-
qpdf \
118-
${outfileName}-no-meta.pdf \
119-
--remove-metadata \
120-
--deterministic-id \
121-
${outfileName}.pdf
122-
123-
mkdir $out
124-
cp ${outfileName}.pdf $out/
125-
'';
126-
}
127-
)
128-
) { };
129-
130-
}
131-
);
132-
})
133-
13422
]
Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,46 @@
11
{
2-
lib,
32
buildPythonPackage,
43
fetchFromGitHub,
54
hatchling,
5+
lib,
6+
pytestCheckHook,
7+
typing-extensions,
68
}:
7-
8-
buildPythonPackage rec {
9+
let
10+
version = "6.1";
11+
in
12+
buildPythonPackage {
913
pname = "coloraide";
10-
version = "4.5.1";
14+
inherit version;
1115
pyproject = true;
1216

1317
src = fetchFromGitHub {
1418
owner = "facelessuser";
1519
repo = "coloraide";
1620
tag = version;
17-
hash = "sha256-/jhVYJE3zxnSTPTFWB4CWw3TPq1qyte+hN7hcgzbbkE=";
21+
hash = "sha256-hsuFouesw4B9rr17NCQVB6LyYUdNRm9Cj2Cqj+MdLkc=";
1822
};
1923

2024
build-system = [
2125
hatchling
2226
];
2327

28+
dependencies = [
29+
typing-extensions
30+
];
31+
2432
pythonImportsCheck = [
2533
"coloraide"
2634
];
2735

36+
nativeCheckInputs = [
37+
pytestCheckHook
38+
];
39+
2840
meta = {
2941
description = "A library to aid in using colors";
3042
homepage = "https://github.com/facelessuser/coloraide";
3143
license = lib.licenses.mit;
32-
maintainers = with lib.maintainers; [ djacu ];
44+
maintainers = [ ];
3345
};
3446
}

0 commit comments

Comments
 (0)