1
Fork 0
shimmeringmoon/nix/shimmeringmoon.nix

79 lines
1.8 KiB
Nix
Raw Normal View History

2024-10-04 15:17:15 +02:00
{
2025-02-11 21:38:56 +01:00
lib,
2024-10-04 15:17:15 +02:00
pkg-config,
makeWrapper,
2025-03-03 10:58:23 +01:00
symlinkJoin,
2024-10-04 15:17:15 +02:00
freetype,
fontconfig,
openssl,
sqlite,
2025-02-11 18:35:38 +01:00
rustPlatform,
shimmering-fonts,
2025-02-12 05:52:24 +01:00
arcaea-ptt-data,
private-config,
2025-03-03 10:58:23 +01:00
shimmeringdarkness,
}:
2025-03-03 10:58:23 +01:00
let
# We bake the env vars into the binaries in a separate derivation,
# such that changing cc data/the content bundle doesn't rebuild the bot.
unpatched = rustPlatform.buildRustPackage {
pname = "shimmeringmoon";
version = "unstable-2025-02-11";
src = lib.fileset.toSource {
root = ../.;
fileset = lib.fileset.unions [
../Cargo.lock
../Cargo.toml
../migrations
../src
];
};
2025-03-03 10:58:23 +01:00
SHIMMERING_FONT_DIR = shimmering-fonts;
SHIMMERING_COMPTIME_PRIVATE_CONFIG_DIR = shimmeringdarkness;
2025-03-03 10:58:23 +01:00
nativeBuildInputs = [ pkg-config ];
2025-03-03 10:58:23 +01:00
buildInputs = [
freetype
fontconfig
sqlite
openssl
];
2025-03-03 10:58:23 +01:00
useFetchCargoVendor = true;
cargoLock = {
lockFile = ../Cargo.lock;
outputHashes = {
"plotters-0.4.0" = "sha256-9wtd7lig1vQ2RJVaEHdicfPZy2AyuoNav8shPMZ1EuE=";
"faer-0.19.4" = "sha256-VXMk2S3caMMs0N0PJa/m/7aPykYgeXVVn7GWPnG63nQ=";
"poise-0.6.1" = "sha256-44pPe02JJ97GEpzAXdQmDq/9bb4KS9G7ZFVlBRC6EYs=";
};
2024-10-04 15:17:15 +02:00
};
2025-03-03 10:58:23 +01:00
# Disable all tests
doCheck = false;
2025-03-03 10:58:23 +01:00
meta = {
description = "Arcaea score management toolchain";
homepage = "https://git.moonythm.dev/prescientmoon/shimmeringmoon";
mainProgram = "shimmering-cli";
platforms = [ "x86_64-linux" ];
};
};
in
symlinkJoin {
inherit (unpatched) name meta;
paths = [ unpatched ];
nativeBuildInputs = [ makeWrapper ];
postBuild = ''
2025-02-11 07:04:39 +01:00
for file in $out/bin/*; do
wrapProgram $file \
2025-02-12 05:52:24 +01:00
--set SHIMMERING_CC_DIR "${arcaea-ptt-data}" \
2025-02-11 07:04:39 +01:00
--set SHIMMERING_PRIVATE_CONFIG_DIR ${private-config}
done
'';
}