iceshrimp: use tarball

This commit is contained in:
twoneis 2025-03-23 15:28:15 +01:00
parent 8ee2d1a953
commit aa02a442a2
2 changed files with 35 additions and 15 deletions

View file

@ -37,7 +37,7 @@ in {
base = web-domain;
};
email = "akkoma@${email-domain}";
iceshrimp.enable = false;
# iceshrimp.enable = false;
};
matrix = {

View file

@ -1,31 +1,51 @@
{
buildDotnetModule,
stdenv,
fetchurl,
autoPatchelfHook,
makeWrapper,
zstd,
dotnetCorePackages,
}: let
version = "v2025.1-beta5.patch2.security1";
in
buildDotnetModule {
stdenv.mkDerivation {
pname = "iceshrimp";
version = "2025.1";
src = builtins.fetchGit {
url = "https://iceshrimp.dev/iceshrimp/Iceshrimp.NET/";
ref = version;
rev = "aac23cce7b577e6ed58ec9bf1fde4f04c26ff624";
src = fetchurl {
url = "https://iceshrimp.dev/iceshrimp/Iceshrimp.NET/releases/download/v2025.1-beta5.patch2.security1/Iceshrimp.NET-${version}-linux-amd64-glibc.tar.zst";
hash = "sha256-Uwstie81M3kM9CjukIG+wXpxp91uTuXFMB/fZlFWsMk=";
};
dotnet-sdk = dotnetCorePackages.sdk_9_0;
dotnet-runtime = dotnetCorePackages.runtime_9_0;
nativeBuildInputs = [
stdenv.cc.cc.lib
zstd
autoPatchelfHook
makeWrapper
];
projectFile = "Iceshrimp.NET.sln";
buildInputs = [
dotnetCorePackages.sdk_9_0
];
nugetDeps = ./deps.json;
unpackPhase = ''
runHook preUnpack
buildPhase = ''
runHook preBuild
mkdir -p $out $out/lib $out/etc
make publish
tar xf $src
runHook postBuild
cp -r Iceshrimp.NET-${version}-linux-amd64-glibc/* $out/lib
mv $out/lib/configuration.ini $out/etc
runHook postUnpack
'';
postFixup = ''
makeWrapper $out/lib/Iceshrimp.Backend $out/bin/iceshrimp \
--set DOTNET_ROOT ${dotnetCorePackages.sdk_9_0}/share/dotnet/ \
--set ICESHRIMP_CONFIG $out/etc/configuration.ini \
--set ICESHRIMP_CONFIG_OVERRIDES $out/etc/configuration.overrides.ini
'';
}