nyazoom/package.nix

50 lines
811 B
Nix
Raw Normal View History

2025-01-12 14:17:55 -08:00
{ lib
, stdenv
, rustPlatform
2024-12-26 23:33:24 -08:00
# Runtime Deps
, sqlite
2025-01-12 14:17:55 -08:00
, openssl
2024-12-26 23:33:24 -08:00
# Build Deps
, pkg-config
2025-01-12 14:17:55 -08:00
# Darwin Build Deps
, darwin
2024-12-26 23:33:24 -08:00
}:
2025-01-11 14:05:27 -08:00
let
rawManifest = builtins.readFile ./Cargo.toml;
manifest = builtins.fromTOML rawManifest;
in
rustPlatform.buildRustPackage {
2025-01-11 14:05:27 -08:00
pname = manifest.package.name;
version = manifest.package.version;
2024-12-26 23:33:24 -08:00
src = ./.;
2025-01-12 17:06:44 -08:00
cargoLock.lockFile = ./Cargo.lock;
2024-12-26 23:33:24 -08:00
nativeBuildInputs = [
openssl
pkg-config
2025-01-12 14:17:55 -08:00
] ++ lib.optional stdenv.hostPlatform.isDarwin darwin.apple_sdk.frameworks.SystemConfiguration;
2024-12-26 23:33:24 -08:00
buildInputs = [
openssl
sqlite
];
2024-12-27 01:50:35 -08:00
2024-12-27 05:26:54 -08:00
postInstall = /* bash */ ''
mkdir $out/dist
cp -r $src/dist/* $out/dist
'';
2024-12-27 01:50:35 -08:00
meta = {
2025-01-12 14:37:33 -08:00
description = "file sharing but with cats";
2024-12-27 01:50:35 -08:00
mainProgram = "nyazoom";
2025-01-12 14:37:33 -08:00
homepage = "https://nyazoom.zynh.me";
2024-12-27 01:50:35 -08:00
};
2024-12-26 23:33:24 -08:00
}