aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2024-06-21 09:11:01 -0400
committerXe Iaso <me@xeiaso.net>2024-06-21 09:11:06 -0400
commitdcdec223cc059f1d49869b4907b22f62cd5c9629 (patch)
tree85923cd3673e0d184817dd60118b788bf0b31ea2 /flake.nix
parent43415b598355db3e9c675b8cec9c54c5d0d3e8cf (diff)
downloadxesite-dcdec223cc059f1d49869b4907b22f62cd5c9629.tar.xz
xesite-dcdec223cc059f1d49869b4907b22f62cd5c9629.zip
fix flake builds
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix59
1 files changed, 40 insertions, 19 deletions
diff --git a/flake.nix b/flake.nix
index a20207c..6ee432a 100644
--- a/flake.nix
+++ b/flake.nix
@@ -30,27 +30,18 @@
alpineLinux = {
flake = false;
- url = "file+https://cdn.xeiaso.net/file/christine-static/hack/alpine-amd64-3.19.0-1.tar";
+ url =
+ "file+https://cdn.xeiaso.net/file/christine-static/hack/alpine-amd64-3.19.0-1.tar";
};
};
- outputs =
- { self
- , nixpkgs
- , flake-utils
- , deno2nix
- , iosevka
- , typst
- , gomod2nix
- , alpineLinux
- , ...
- }:
+ outputs = { self, nixpkgs, flake-utils, deno2nix, iosevka, typst, gomod2nix
+ , alpineLinux, ... }:
flake-utils.lib.eachSystem [
"x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
- ]
- (system:
+ ] (system:
let
graft = pkgs: pkg:
pkg.override { buildGoModule = pkgs.buildGo122Module; };
@@ -89,8 +80,7 @@
# Generate a user-friendly version number.
version = builtins.substring 0 8 self.lastModifiedDate;
- in
- rec {
+ in rec {
packages = rec {
bin = pkgs.buildGoApplication {
pname = "xesite_v4";
@@ -108,6 +98,37 @@
subPackages = [ "cmd/patreon-saasproxy" ];
};
+ iosevka = pkgs.stdenvNoCC.mkDerivation {
+ name = "xesite-iosevka";
+ buildInputs = with pkgs; [
+ python311Packages.brotli
+ python311Packages.fonttools
+ ];
+ dontUnpack = true;
+ buildPhase = ''
+ mkdir -p out
+ ${pkgs.unzip}/bin/unzip ${
+ self.inputs.iosevka.packages.${system}.default
+ }/ttf.zip
+ for ttf in ttf/*.ttf; do
+ cp $ttf out
+ name=`basename -s .ttf $ttf`
+ pyftsubset \
+ $ttf \
+ --output-file=out/"$name".woff2 \
+ --flavor=woff2 \
+ --layout-features=* \
+ --no-hinting \
+ --desubroutinize \
+ --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"
+ done
+ '';
+ installPhase = ''
+ mkdir -p $out/static/css/iosevka
+ cp out/* $out/static/css/iosevka
+ '';
+ };
+
docker = pkgs.dockerTools.buildLayeredImage {
name = "ghcr.io/xe/site/bin";
tag = "latest";
@@ -130,9 +151,7 @@
contents = with pkgs; [ cacert ];
config = {
Cmd = [ "${patreon-bin}/bin/patreon-saasproxy" ];
- Env = [
- "HOME=/data"
- ];
+ Env = [ "HOME=/data" ];
Volumes."/data" = { };
};
};
@@ -167,6 +186,8 @@
jq
jo
+ earthly
+
# tools
ispell
pandoc