Skip to content

Commit dcdec22

Browse files
committed
fix flake builds
Signed-off-by: Xe Iaso <[email protected]>
1 parent 43415b5 commit dcdec22

File tree

1 file changed

+40
-19
lines changed

1 file changed

+40
-19
lines changed

flake.nix

Lines changed: 40 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,18 @@
3030

3131
alpineLinux = {
3232
flake = false;
33-
url = "file+https://cdn.xeiaso.net/file/christine-static/hack/alpine-amd64-3.19.0-1.tar";
33+
url =
34+
"file+https://cdn.xeiaso.net/file/christine-static/hack/alpine-amd64-3.19.0-1.tar";
3435
};
3536
};
3637

37-
outputs =
38-
{ self
39-
, nixpkgs
40-
, flake-utils
41-
, deno2nix
42-
, iosevka
43-
, typst
44-
, gomod2nix
45-
, alpineLinux
46-
, ...
47-
}:
38+
outputs = { self, nixpkgs, flake-utils, deno2nix, iosevka, typst, gomod2nix
39+
, alpineLinux, ... }:
4840
flake-utils.lib.eachSystem [
4941
"x86_64-linux"
5042
"aarch64-linux"
5143
"aarch64-darwin"
52-
]
53-
(system:
44+
] (system:
5445
let
5546
graft = pkgs: pkg:
5647
pkg.override { buildGoModule = pkgs.buildGo122Module; };
@@ -89,8 +80,7 @@
8980

9081
# Generate a user-friendly version number.
9182
version = builtins.substring 0 8 self.lastModifiedDate;
92-
in
93-
rec {
83+
in rec {
9484
packages = rec {
9585
bin = pkgs.buildGoApplication {
9686
pname = "xesite_v4";
@@ -108,6 +98,37 @@
10898
subPackages = [ "cmd/patreon-saasproxy" ];
10999
};
110100

101+
iosevka = pkgs.stdenvNoCC.mkDerivation {
102+
name = "xesite-iosevka";
103+
buildInputs = with pkgs; [
104+
python311Packages.brotli
105+
python311Packages.fonttools
106+
];
107+
dontUnpack = true;
108+
buildPhase = ''
109+
mkdir -p out
110+
${pkgs.unzip}/bin/unzip ${
111+
self.inputs.iosevka.packages.${system}.default
112+
}/ttf.zip
113+
for ttf in ttf/*.ttf; do
114+
cp $ttf out
115+
name=`basename -s .ttf $ttf`
116+
pyftsubset \
117+
$ttf \
118+
--output-file=out/"$name".woff2 \
119+
--flavor=woff2 \
120+
--layout-features=* \
121+
--no-hinting \
122+
--desubroutinize \
123+
--unicodes="U+0000-0170,U+00D7,U+00F7,U+2000-206F,U+2074,U+20AC,U+2122,U+2190-21BB,U+2212,U+2215,U+F8FF,U+FEFF,U+FFFD,U+00E8"
124+
done
125+
'';
126+
installPhase = ''
127+
mkdir -p $out/static/css/iosevka
128+
cp out/* $out/static/css/iosevka
129+
'';
130+
};
131+
111132
docker = pkgs.dockerTools.buildLayeredImage {
112133
name = "ghcr.io/xe/site/bin";
113134
tag = "latest";
@@ -130,9 +151,7 @@
130151
contents = with pkgs; [ cacert ];
131152
config = {
132153
Cmd = [ "${patreon-bin}/bin/patreon-saasproxy" ];
133-
Env = [
134-
"HOME=/data"
135-
];
154+
Env = [ "HOME=/data" ];
136155
Volumes."/data" = { };
137156
};
138157
};
@@ -167,6 +186,8 @@
167186
jq
168187
jo
169188

189+
earthly
190+
170191
# tools
171192
ispell
172193
pandoc

0 commit comments

Comments
 (0)